-
Notifications
You must be signed in to change notification settings - Fork 497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: PURL to CPE conversion results in "UNKOWN" vendor when CPE is given #4700
Comments
Ugh, that is spectacularly not the behaviour we want. I think the correct behaviour here would be to provide both (and collapse appropriately if they yield the same thing so you don't get duplicate CVEs). Not sure when we'll get a fix in since I'm currently having some problems with cache updates that need fixing before any PRs will merge cleanly, but thank you for the report and hopefully we'll get to it soon! |
@terriko I was trying to reproduce this and found something strange in parse.py
But at parse.py#L382, purl is checked before CPE 2.3 and CPE 2.2
With this change, I get the correct output
|
@AryanBakliwal @terriko The emerging industry standard is to use PURLs over CPEs as CPE data is inconsistent and buggy. The order of evaluation should therefore be if there is a PURL to use this identifier in preference to a CPE. However, PURLs do not have a vendor associated with them so a vendor of UNKNOWN could be expected. If there is both PURL and CPE, the vendor from the CPE could be used. Using CPEs in preference to PURLs will lead to many more vulnerabilities being missed, particularly for open source components. |
Description
I have an SPDX SBOM which contains PURL and CPE data:
if I scan this with cve-bin-tool 3.4 I get:
So it seems that the PURL to CPE conversion failed to identify a vendor and overwrote a valid CPE which was present.
If I delete the PURL, it works as expected
Output:
With Version 3.3 it also works as expected (I assume there was something changed in the PURL to CPE Logic).
To reproduce
Steps to reproduce the behaviour:
cpe:2.3:a:arm:mbed_tls:3.6.0:*:*:*:*:*:*:*
andpkg:github/Mbed-TLS/[email protected]
) with e.g.cve-bin-tool --sbom spdx --sbom-file modules-deps.spdx
Expected behaviour: CVEs should be matched if CPEs are given in the SBOM
Actual behaviour: PURL to CPE fail to identify the correct vendor and still have a higher priority than the given CPE
Version/platform info
Version of CVE-bin-tool( e.g. output of
cve-bin-tool --version
): 3.4Installed from pypi or github? Pypi
Operating system: Linux Ubuntu (
Linux 5.4.0-204-generic #224-Ubuntu SMP
)Python version (e.g.
python3 --version
): Python 3.11.10Running in any particular CI environment we should know about? no
Anything else?
Feel free to add any other context here.
The text was updated successfully, but these errors were encountered: