False negative: trivy sbom on Syft SPDX-JSON retains 1 of 151 packages and reports 0 vulnerabilities, where CycloneDX from the same Syft run on the same tar reports 137 #11140
Replies: 1 comment
|
Trivy finds the operating system in SPDX only by the The packages are read correctly. But the OS is unknown and there are packages, so Trivy sets the family to @knqyf263 #7101 was closed and #9034 was merged instead, because wolfi-base does have One more thing on the SPDX side. The component type is taken from the SPDXID prefix ( @GautamTalksDev as a workaround, |
Uh oh!
There was an error while loading. Please reload this page.
IDs
N/A - false negative. 0 unique CVE IDs on the SPDX path where trivy image on the same tar reports 409.
Description
Related to #11139 but a different path and a much larger effect. #11139 is
the CycloneDX SrcName under-count. Here the OS packages are skipped
entirely. Filing separately because the debug output points at a different
cause.
What the debug output shows
Same image tar, same Syft binary, same Trivy binary, same DB, same minute.
Only the SBOM format differs.
SPDX:
INFO Detected SBOM format format="spdx-json"
INFO Detected OS family="none" version=""
WARN Unsupported os family="none"
INFO Number of language-specific files num=1
CycloneDX:
INFO Detected SBOM format format="cyclonedx-json"
INFO Detected OS family="debian" version="12.5"
INFO [debian] Detecting vulnerabilities... os_version="12" pkg_num=149
On the SPDX path no OS is detected, the family is declared unsupported, and
OS package detection never runs. 151 packages carrying valid
pkg:deb/debian/... PURLs are present in the document on disk. One package
survives, and it is a genuine maven component
(pkg:maven/libintl/libintl@0.21), not a misread deb.
Same shape on debian:bookworm-slim: 89 packages with PURLs in the SPDX
document, 0 packages and 0 vulnerabilities from trivy sbom, 87 unique
vulnerabilities from trivy image.
Prior art I found and how I think this differs
#8629 reports RPMs not scanned in a Red Hat cosign SPDX document with the
same "no OS detected" shape, and #7100 added OS detection from PURL when
the OS component is missing. So the general failure is known and there is
already a fallback on at least one path.
What I think is new here, and I may be wrong: this is a Syft-generated
SPDX document on a Debian image where every OS package carries a valid
pkg:deb/debian/... PURL, and the same Syft run's CycloneDX output detects
debian 12.5 correctly from the same tar. If the PURL fallback from #7100
applies to this path, it is not firing on these documents.
Grype reading the same Syft SPDX document retains the packages and matches
its own direct image scan, so the information is present and consumable by
another consumer.
What I can and cannot say
I measured that the package data is present in the input and absent from
the output, and that Trivy reports no OS on the SPDX path and debian 12.5
on the CycloneDX path for the same image. I have not read the ingest code
and am not asserting where in it the OS determination diverges.
Why this matters more than a partial under-count
A zero is indistinguishable from a genuinely clean image from outside.
Some organizations standardize on SPDX for compliance deliverables, and on
that path this produces a clean report from a complete and valid SBOM.
Would it be in scope either to derive the OS from pkg:deb and pkg:apk
externalRef PURL locators on the SPDX path as #7100 does elsewhere, or to
warn when a document contains OS package PURLs and no OS family is
detected?
Happy to attach both SBOM fixtures.
Reproduction Steps
Target
SBOM
Scanner
Vulnerability
Target OS
Debian 12 (not detected on the SPDX path; this is the bug)
Debug Output
Version
Version: 0.72.0 Vulnerability DB: Version: 2 UpdatedAt: 2026-08-25 06:59:59.307495517 +0000 UTC NextUpdate: 2026-08-26 06:59:59.307495287 +0000 UTC DownloadedAt: 2026-08-25 07:25:13.65940968 +0000 UTC Java DB: Version: 1 UpdatedAt: 2026-08-24 01:07:04.599776272 +0000 UTC NextUpdate: 2026-08-27 01:07:04.599776152 +0000 UTC DownloadedAt: 2026-08-24 07:00:25.559842448 +0000 UTC Note: 0.74.0 is available and I have not tested it yet. Happy to retest and report back if the behaviour differs.Checklist
-f jsonthat shows data sources and confirmed that the security advisory in data sources was correctAll reactions