Skip to content
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: don't report vulnerabilities multiple times under different aliases #61

Merged
merged 1 commit into from
Mar 12, 2022

Conversation

G-Rath
Copy link
Owner

@G-Rath G-Rath commented Mar 12, 2022

Not super happy about this one as it feels really inefficient to be constantly doing the same bunch of loops over and over, but I can't think of a more efficient way of doing this - the main issue is that not everyone lists all their aliases, so we just have to check them from every angle...

This messed with my brain a bunch, so I've made Include public for now to be able to have a explicit test but will replace that once I've had time to look into writing tests for the database (which require running a test http server to provide the db archive).

Overall this is primarily "just" for the PyPip ecosystem as their database has both GHSA and PYSEC vulnerabilities, with the GHSA ones having been pulled from PYSEC in the first place; however what they are doing is completely valid so we should be having this logic as any database could do it.

Oh and currently this is first-in-wins based which means GHSAs "win" over PYSEC since they're listed alphabetically, but I expect GHSA entries to always be more fulsome so it would be nice at some point to look into having them be preferred as part of this logic (though that'd also be adding more expense, since we'd have to recompute the splice to replace the entry, maybe?)

(btw while I'm talking about this as being inefficient, it's relative - I expect this is a lot faster than it actually looks, because Go 🤷)

@G-Rath G-Rath merged commit 6aa6173 into main Mar 12, 2022
@G-Rath G-Rath deleted the try-deduplicate-aliased-osvs branch March 12, 2022 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant