Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
6fbd7a6 to
10ec3d4
Compare
|
I am not used to read Go, but the changes look good to me. |
10ec3d4 to
bc8c327
Compare
|
@jess-lowe any thoughts on this approach (can obviously do the update for the conflict but if you're disagreeing with the overall, won't spend the time on it) |
|
Hey @katzj, it's generally looking pretty reasonable - I just have haven't had the time to review in depth. Should finally have time to have a good look and test everything next week. Thanks for bearing with me! |
CVE5 records from some CNAs carry a packageURL for the affected package. Add a small package that maps a purl to an OSV ecosystem and package name, covering the types the CVE5 converter needs. It lives in vulnfeeds because that is a separate module from the main go module's purl package.
Add PackageVersionExtractor, which wraps a base extractor and additionally emits affected entries carrying an OSV package and ECOSYSTEM ranges for affected blocks with a supported packageURL. The Git ranges from the base extractor are kept. Git versions in a block are ignored here. This is not wired to any CNA yet.
These CNAs identify the affected package with a purl in their CVE records, but the converter only produced Git ranges, so the records could not be matched by package name and version. Use the package extractor for them.
bc8c327 to
93fc061
Compare
| var ecosystems = map[string]osvconstants.Ecosystem{ | ||
| "cargo": osvconstants.EcosystemCratesIO, | ||
| "composer": osvconstants.EcosystemPackagist, | ||
| "conan": osvconstants.EcosystemConanCenter, | ||
| "gem": osvconstants.EcosystemRubyGems, | ||
| "golang": osvconstants.EcosystemGo, | ||
| "maven": osvconstants.EcosystemMaven, | ||
| "npm": osvconstants.EcosystemNPM, | ||
| "nuget": osvconstants.EcosystemNuGet, | ||
| "pypi": osvconstants.EcosystemPyPI, | ||
| } |
There was a problem hiding this comment.
hex and opam publish purls in their CVEs as well.
|
Hey @katzj, really sorry for the slow turnaround here, and thank you for checking in before spending time rebasing! After sitting with this and looking more closely at the implications (especially seeing interest in expanding purl mappings to more ecosystems already), I actually want to walk back my initial take and push against emitting ECOSYSTEM package ranges from the CVE converter. Architecturally, we want to keep a strict boundary in OSV: CVE conversion (vulnfeeds) is strictly for deriving GIT commit ranges verified against repositories, while ECOSYSTEM package/version ranges should come from native, authoritative OSV feeds (like GHSA, PyPA, RustSec, etc.). Blurring that boundary by trusting unverified purls and version strings in CVE records, and marking records Successful even when Git resolution fails, opens the door to duplicate/conflicting package advisories and gradual scope creep across CNAs. Instead of doing CVE-to-package conversion here, we'd much rather work with these upstream organizations to publish native OSV feeds directly (or rely on existing native feeds where they already overlap. For instance, CVE-2026-15631 for OpenJS already has GHSA-7hrw-592w-9wh2 covering the npm range). Both Apache and Bouncy Castle already use automated advisory tooling/templates, so hosting native OSV records in a Git repo or bucket that osv.dev ingests directly as a first-class source would give users cleaner, authoritative data without coupling it to CVE5 purl heuristics. Really appreciate the clean code and thorough tests you put into this, and sorry again for the change of direction after my earlier comment. Happy to discuss further on #6137 on how we can approach upstream native OSV publishing for Apache and Bouncy Castle instead! |
Overview
CVE5 records from some CNAs identify the affected package with a
packageURL, but the converter only produced Git ranges, so those CVEs could not be matched by package name and version. This adds a package entry with ECOSYSTEM ranges, next to the existing Git ranges, for the apache, bcorg (Bouncy Castle), and openjs CNAs.Part of #6137.
Details
vulnfeeds/purl: maps a purl to an OSV ecosystem and package name.vulnfeedsis a separate module, so this does not reusego/purl.PackageVersionExtractor: wraps the default extractor and adds one affected entry per package, with ranges taken from the record'sversions. It marks the outcomeSuccessfulwhen it adds a package, sinceNoReposand similar outcomes would otherwise be rejected by-reject-failed.collectionURL, because Bouncy Castle's is not Maven Central.Testing
go test ./...invulnfeedsandpython3 tools/lint_and_format.pypass.This PR was AI-assisted (Claude Code) and follows AGENTS.md.