fix: include release component in upstream qualifier #740
Conversation
The upstream qualifier in the PURL was only including the version from the source RPM, omitting the release component. This caused false positive vulnerabilities for RHEL 10 packages where the installed version was equal to or greater than the fix version. Example: - Before: upstream=glibc@2.39 (missing release) - After: upstream=glibc@2.39-46.el10_0 (complete version) This caused version comparison failures because in RPM versioning, a version without a release is considered older than the same version with a release: 2.39 < 2.39-43.el10_0 → TRUE (incorrectly triggers vulnerability)
PR Reviewer Guide 🔍
|
SteveShani
left a comment
There was a problem hiding this comment.
We're sure that vuln service knows how to handle this?
abdb36f
PR Reviewer Guide 🔍
|
abdb36f to
90c0fff
Compare
PR Reviewer Guide 🔍
|
PR Reviewer Guide 🔍
|
|
🎉 This PR is included in version 8.15.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What does this PR do?
Fixes a regression introduced in CLI version 1.1298.1+ that cause false positive vulnerabilities reported when scanning RHEL 10 container images.
The issue is in how the
upstreamqualifier in the PURL is constructed for RPM packages. We only included the version from the source RPM, omitting the release component:upstream=glibc@2.39upstream=glibc@2.39-46.el10_0This causes version comparison failures because in RPM versioning, a version without a release is considered older than the same version with a release.
Example: Epoch 0 False Positive (libarchive)
This was a false positive because
3.7.7-4.el10_0and0:3.7.7-4.el10_0are the same version (the "0:" is the default epoch prefix). Without the release in the upstream qualifier, the comparison3.7.7 < 3.7.7-4.el10_0incorrectly evaluates to TRUE.Where should the reviewer start?
lib/analyzer/package-managers/rpm.ts- thepurlfunction where the upstream qualifier is constructed (lines 48-59).How should this be manually tested?
False positives that should no longer appear:
Any background context you want to provide?
Why source package matching for RHEL 10:
From RHEL 10 onward, Red Hat publishes vulnerability data in CSAF/VEX format (replacing OVAL). This new format references source packages instead of binary packages. The
upstreamqualifier in the PURL identifies the source package for accurate vulnerability matching.Note on Epoch Prefix:
The "0:" prefix in versions like
0:3.7.7-4.el10_0is the RPM epoch (default value). Versions3.7.7-4.el10_0and0:3.7.7-4.el10_0are semantically identical. The false positives occurred because the missing release component causes incorrect version comparisons, not because of epoch handling.What are the relevant tickets?
Addresses customer-reported false positives for RHEL 10 images affecting:
Screenshots
N/A
Additional questions
None