Replies: 2 comments
-
This is a primary use case for me. The idea is this: filea.c had a git hash of X1 when it was pulled from a repo, and is part of Package P. Due to whatever integration, it now has hash X2. Now a vulnerability is announced on Package P with filea with hash X1. Question: how should one spot the problem, and how does one know the state of that file? Several thoughts:
In that latter case, the maintainer could conceivably provide the hash db from use case 1, but that could get quite large and you cannot see whether the correction was applied. To fix that latter problem, as a matter of operational practice, if the githash of both the vulnerable and corrected code is provided in an advisory, then the maintainer can rewind, apply the change, and then re-apply any integration work. This leads to how to indicate that the fixed code is present, without having to provide the lengthy history. THAT hash is absolutely meta-data but critical meta-data. So let’s not lose it. |
Beta Was this translation helpful? Give feedback.
-
Hi Eliot, Thanks for creating this issue. This issue looks like an issue that has been solved by Bomsh for CVE search using gitBOM. well, perhaps not perfectly solved, but partially solved. I would like to share with you of Bomsh's implementation for this issue. For CVE searching, we have noticed that some Linux distros like Fedora/Centos apply its own patches (including backporting of CVE fixes) on top of the official OpenSSL source tarballs, which creates new blob IDs that do not exist in the official OpenSSL git repo. The bomsh_create_cve.py script scans the whole OpenSSL git repo and creates the CVE database for all CVE-relevant blob IDs, which do not include the newly created blob IDs by Fedora/Centos. As a result, when running bomsh_search_cve.py script, it reports a warning as below:
The bomsh_create_cve.py script has been enhanced to scan the git repo of the Fedora/Centos, and find all the newly created blob IDs for all the git commits. With the help of CVE checking rules, this script generates the database for these new blob IDs like below:
It evaluates each source file directly with the CVE checking rules and also it tells you the baseline githash (the "baseline_blob_id" field). This way, Bomsh can create a CVE database that covers the new blob IDs that are created by Fedora/centos distros too. There is another scenario that Bomsh supports: when generating gitBOM tree with Bomsh, bomsh_hook2.py script can directly check the source files against the CVE checking rules, and generate some metadata regarding the CVE check results. These additional metadata is put into .gitbom/metadata/bomsh/ directory, and later when searching CVE, the bomsh_search_cve.py script utilizes these CVE metadata, and can report CVE vulnerability for binaries. This cover all newly found blob IDs that do not exist in the CVE database. But anyway, bomsh_search_cve.py script reports a warning when such non-existent blob IDs are found during CVE search, which prompts users to manually inspect those source files. For the implementation details, please check the Bomsh git repo and the openssl-cve repo: Bomsh: https://github.com/git-bom/bomsh |
Beta Was this translation helpful? Give feedback.
-
What to do when you've made a change to a file and hash is changed, but there is a vulnerability associated with the old hash? Should the old hash be in the gitbom?
Beta Was this translation helpful? Give feedback.
All reactions