8000 fix: fall back to fuzzy constraint units by willmurphyscode · Pull Request #2651 · anchore/grype · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: fall back to fuzzy constraint units #2651

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

Merged
merged 1 commit into from
May 9, 2025

Conversation

willmurphyscode
Copy link
Contributor

If a given constraint unit cannot be parsed as its labeled type, try parsing it as a fuzzy version. In this way matching can be attempted even in the face of surprising upstream data.

See #2642 for a discussion of why. A companion grype-db PR will be up in a moment to write these range entries into the database as fuzzy entries.

The core issue here is how to handle GHSA entries whose version constraint is not a valid version for the language ecosystem that the affected package belongs to. The heuristic implemented in this PR helps with the Go and Python GHSAs that we are aware of, but doesn't help with the Ruby GHSAs. Follow #2646 for the Ruby-specific work needed here.

If a given constraint unit cannot be parsed as its labeled type, try
parsing it as a fuzzy version. In this way matching can be attempted
even in the face of surprising upstream data.

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
@willmurphyscode willmurphyscode merged commit 2a964c4 into main May 9, 2025
12 checks passed
@willmurphyscode willmurphyscode deleted the fallback-to-fuzzy-constraint branch May 9, 2025 15:57
@wagoodman wagoodman added the bug Something isn't working label May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0