fix: skip withdrawn OSV advisories in parse_advisory_data_v3#2240
Open
shivamshrma09 wants to merge 1 commit intoaboutcode-org:mainfrom
Open
fix: skip withdrawn OSV advisories in parse_advisory_data_v3#2240shivamshrma09 wants to merge 1 commit intoaboutcode-org:mainfrom
shivamshrma09 wants to merge 1 commit intoaboutcode-org:mainfrom
Conversation
Withdrawn advisories were being imported by the v2 pipeline because parse_advisory_data_v3 in pipes/osv_v2.py had no withdrawn check. This caused packages like pkg:pypi/py@1.11.0 to appear as affected even though the advisory (e.g. GHSA-w596-4wvx-j9j6) was withdrawn. Add a withdrawn check at the top of parse_advisory_data_v3, consistent with the existing check in parse_advisory_data (v1). This fix covers all 5 pipelines that use parse_advisory_data_v3: github_osv_importer, oss_fuzz, pypa_importer, pysec_importer, ubuntu_osv_importer. Add tests for both withdrawn and non-withdrawn cases in test_osv_v2.py. Fixes aboutcode-org#2238 Signed-off-by: shivamshrma09 <shivamsharma27107@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2238
pkg:pypi/py@1.11.0was shown as affected in GitHub and GitLab advisories even though the advisoryGHSA-w596-4wvx-j9j6was withdrawn.Root Cause
parse_advisory_data_v3inpipes/osv_v2.pyhad nowithdrawncheck, so withdrawn advisories were being imported by the v2 pipeline.Changes
pipes/osv_v2.py: Addedwithdrawncheck at the top ofparse_advisory_data_v3, consistent with the existing check inparse_advisory_data(v1). This covers all 5 pipelines using this function:github_osv_importer,oss_fuzz,pypa_importer,pysec_importer,ubuntu_osv_importer.importers/osv.py: Addedwithdrawncheck inparse_advisory_data(v1).importers/github_osv.py: GuardyieldagainstNonereturn.tests/pipes/test_osv_v2.py: Added tests for withdrawn and non-withdrawn cases.tests/test_osv.py: Added tests for withdrawn and non-withdrawn cases.Signed-off-by: shivamshrma09 shivamsharma27107@gmail.com