Skip to content

osv-scanner 2.0 does not consider nested components in CycloneDX SBOM #1717

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

Closed
davids-work opened this issue Mar 17, 2025 · 0 comments · Fixed by google/osv-scalibr#572 or #1749
Closed
Labels
bug Something isn't working

Comments

@davids-work
Copy link

After updating to osv-scanner 2.0, it seems like nested components in a CycloneDX SBOM are no longer considered.

Example:

{
  "bomFormat": "CycloneDX",
  "specVersion": "1.5",
  "serialNumber": "urn:uuid:77486714-0a72-4d06-ada6-9bf6c4e3a955",
  "version": 1,
  "metadata": {
    "component": {
      "type": "application",
      "bom-ref": "[email protected]",
      "name": "MyApp",
      "version": "1.0.0",
      "author": "MyCompany"
    },
    "timestamp": "2025-03-11T20:14:32.767Z"
  },
  "components": [
    {
      "type": "application",
      "bom-ref": "[email protected]",
      "name": "MyBinary",
      "version": "1.0.0",
      "purl": "pkg:generic/[email protected]",
      "components": [
        {
          "type": "library",
          "bom-ref": "[email protected]",
          "name": "rustls",
          "version": "0.23.13",
          "purl": "pkg:cargo/[email protected]"
        }
      ]
    }
  ]
}
# 1.9.2
> osv-scanner scan --sbom test.cdx.json
Scanned /home/davidsm/test.cdx.json as CycloneDX SBOM and found 2 packages
╭─────────────────────────────────────┬──────┬───────────┬─────────┬─────────┬───────────────╮
│ OSV URL                             │ CVSS │ ECOSYSTEM │ PACKAGE │ VERSION │ SOURCE        │
├─────────────────────────────────────┼──────┼───────────┼─────────┼─────────┼───────────────┤
│ https://osv.dev/GHSA-qg5g-gv98-5ffh │ 6.9  │ crates.io │ rustls  │ 0.23.13 │ test.cdx.json │
│ https://osv.dev/RUSTSEC-2024-0399   │      │ crates.io │ rustls  │ 0.23.13 │ test.cdx.json │
╰─────────────────────────────────────┴──────┴───────────┴─────────┴─────────┴───────────────╯

# 2.0.0
> osv-scanner scan --sbom test.cdx.json
Scanned /home/davidsm/test.cdx.json file and found 1 package
No issues found
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
2 participants