cve-bin-tool icon indicating copy to clipboard operation
cve-bin-tool copied to clipboard

fix: skip SBOM components with UNKNOWN version instead of raising exception

Open nancysangani opened this issue 8 months ago • 0 comments

Fixes #5302

When scanning a CycloneDX SBOM containing a component with version "UNKNOWN", cve_scanner.py raised an unhandled UnknownVersion exception that terminated the entire scan. Components with unknown versions cannot be meaningfully checked for CVEs and should be skipped with a debug log message.

Changes

  • cve_bin_tool/cve_scanner.py: Import UnknownVersion, wrap Version() call in try/except, return early with debug log if version is unknown
  • test/test_cve_scanner_unknown_version.py: Regression tests for UNKNOWN, unknown (lowercase), empty string, and valid version cases

nancysangani avatar Mar 20 '26 14:03 nancysangani