cve-bin-tool
cve-bin-tool copied to clipboard
fix: skip SBOM components with UNKNOWN version instead of raising exception
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: ImportUnknownVersion, wrapVersion()call in try/except, return early with debug log if version is unknowntest/test_cve_scanner_unknown_version.py: Regression tests for UNKNOWN, unknown (lowercase), empty string, and valid version cases