Skip to content

Fix crates.io ecosystem mapping in OSV parsers - #2496

Open
chauhanshiv1711-dot wants to merge 2 commits into
aboutcode-org:mainfrom
chauhanshiv1711-dot:fix-osv-crates-io-mapping
Open

chauhanshiv1711-dot wants to merge 2 commits into
aboutcode-org:mainfrom
chauhanshiv1711-dot:fix-osv-crates-io-mapping

Conversation

@chauhanshiv1711-dot

Copy link
Copy Markdown

Fixes #2485

Problem

In OSV advisory data (e.g. GitHub Advisory Database), Rust packages specify ecosystem: "crates.io".
However, PURL_TYPE_BY_OSV_ECOSYSTEM only mapped "cargo", which caused all crates.io packages to fail ecosystem lookup and get silently dropped without a Package URL.

Solution

  • Added "crates.io": "cargo" to PURL_TYPE_BY_OSV_ECOSYSTEM in both vulnerabilities/importers/osv.py and vulnerabilities/pipes/osv_v2.py.
  • Added unit test test_github_osv_importer_crates_io in vulnerabilities/tests/test_github_osv.py verifying that crates.io ecosystem entries are mapped to pkg:cargo/serde.

Signed-off-by: chauhanshiv1711-dot <chauhanshiv1711@gmail.com>
@chauhanshiv1711-dot
chauhanshiv1711-dot marked this pull request as draft November 12, 2026 16:13
@chauhanshiv1711-dot
chauhanshiv1711-dot marked this pull request as ready for review November 12, 2026 16:13
Signed-off-by: chauhanshiv1711-dot <chauhanshiv1711@gmail.com>

This branch has not been deployed

No deployments
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.

OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargo

1 participant