-
Notifications
You must be signed in to change notification settings - Fork 62
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
Automatically audit packages using both osv and pypi, or document that they may report different results #274
Comments
The two should be in sync. If you can provide the specific example, we can look into it. |
Whoops, @di beat me to it. Yeah, I believe the only times there should be a discrepancy are if the scheduled task is still pending or has failed for some reason. |
@di @woodruffw Please see pypa/advisory-database#65 In this case it was django-celery-results==2.2.0 / GHSA-fvx8-v524-8579, but seems like it could happen for anything and the two aren't always guaranteed to be in sync. Or maybe I'm reading the linked issue incorrectly. |
After looking at the linked GHSA, this could be a bug with the OSV data, or (maybe) a bug with how pip-audit compares package names and versions. We definitely are using django-celery-results==2.2.0, and the GHSA is for versions less than 1.2.1. Running below succeeds:
But running below fails:
With a requirements/base.txt entry like:
|
Looks like PyPI doesn't know about any vulnerabilities for this project:
We did have some hiccups with the ingestion in the last few days, it's possible we might need to do some manual intervention to sync here (cc @oliverchang) |
Workers add additional information to vulnerabilities (e.g. by expanding ranges). With GHSA advisories, they needed this step to be properly propagated to warehouse. Also make the source repo processing faster when loading it from scratch, rather than enumerating through every single commit. This will help pypa/pip-audit#274.
We weren't properly pushing the GHSA entries to warehouse. I have google/osv.dev#429 out to fix this. |
warehouse now knows about GHSA-fvx8-v524-8579:
|
* Move PyPI bridge call to worker from importer. Workers add additional information to vulnerabilities (e.g. by expanding ranges). With GHSA advisories, they needed this step to be properly propagated to warehouse. Also make the source repo processing faster when loading it from scratch, rather than enumerating through every single commit. This will help pypa/pip-audit#274. * add missing test files
Thanks a ton @oliverchang! @juspence: Does re-running the audit now give you the results you expect? |
Yes, the GHSAs reported by |
Glad to hear it! Thanks again for reporting. |
Is your feature request related to a problem? Please describe.
I'm always frustrated when I think there are no security vulnerabilities in my project, but there actually are. My team runs pip-audit as a daily CI job to warn us about CVEs in our Python dependencies.
By default pip-audit uses PyPI, and currently reports no issues for any of our dependencies. But while investigating a dependabot warning today, we reran pip-audit using "--vulnerability-service osv", and saw that there was a django-celery-results GHSA reported in OSV.
Describe the solution you'd like
Obviously pip-audit doesn't control the contents of either the OSV or PyPI databases, and I'm about to go request that those projects synchronize their data. But it would also be nice if pip-audit automatically checked both OSV and PyPI by default:
Describe alternatives you've considered
Add some documentation stating that OSV and PyPI vulnerabilities may differ, and that auditing against both services is recommended. This could be a small snippet in "pip-audit --help", like below:
The text was updated successfully, but these errors were encountered: