fix: reformulation of PR #2582 (TC-5630) for release/0.4.z. - #2587
Merged
Conversation
Reformulation of PR guacsec#2582 (TC-5630) for release/0.4.z. Constrains product_status matches in get_product_statuses_for_purl to advisories whose context CPE matches the describing CPEs of the SBOMs that actually contain the PURL, preventing wrong-product false positives (e.g. a curl advisory matching an unrelated product sharing a package name). Adds a cpe_context_subqueries() helper building: - allowed_cpe_ids: describing CPEs (plus major-version-generalized variants) of SBOMs containing the PURL - sbom_has_cpes: whether those SBOMs carry describing CPEs at all applied as: context_cpe_id IS NULL OR context_cpe_id IN (allowed_cpe_ids) OR NOT EXISTS (sbom_has_cpes) Adapted to 0.4.z: uses sbom_package_purl_ref (0.4.z predates the sbom_node_purl_ref rename); the from_entity purl_status refactor from the upstream commits is a no-op here as 0.4.z has no inline CPE subqueries to extract.
Contributor
Reviewer's GuideAdds CPE-context-aware filtering to the product status lookup for a PURL to avoid wrong-product matches by constraining advisories to SBOM describing CPEs (including generalized variants) of SBOMs that actually contain the PURL. Entity relationship diagram for CPE-context-aware product status filteringerDiagram
QUALIFIED_PURL {
uuid id
}
SBOM_PACKAGE_PURL_REF {
uuid qualified_purl_id
uuid sbom_id
}
SBOM {
uuid id
}
SBOM_DESCRIBING_CPE {
uuid sbom_id
uuid cpe_id
}
CPE {
uuid id
text vendor
text product
text version
}
PRODUCT_STATUS {
uuid context_cpe_id
text package
}
QUALIFIED_PURL ||--o{ SBOM_PACKAGE_PURL_REF : contains_purl
SBOM ||--o{ SBOM_PACKAGE_PURL_REF : has_purl_ref
SBOM ||--o{ SBOM_DESCRIBING_CPE : has_describing_cpe
CPE ||--o{ SBOM_DESCRIBING_CPE : is_describing_cpe_for
CPE ||--o{ PRODUCT_STATUS : may_be_context_cpe
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
rh-jfuller
marked this pull request as draft
August 21, 2026 11:57
rh-jfuller
marked this pull request as ready for review
August 21, 2026 12:05
bc96184 backported a `Response::bytes_stream()` call into test-context but not the corresponding `stream` feature on the reqwest dependency (present on main). Without it, `cargo clippy --all-features` fails to compile test-context, breaking CI for every PR to release/0.4.z. Align with main by enabling the feature.
rh-jfuller
enabled auto-merge
August 21, 2026 16:22
helio-frota
self-requested a review
August 21, 2026 16:26
helio-frota
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Constrains product_status matches in get_product_statuses_for_purl to advisories whose context CPE matches the describing CPEs of the SBOMs that actually contain the PURL, preventing wrong-product false positives (e.g. a curl advisory matching an unrelated product sharing a package name). Adds a cpe_context_subqueries() helper building:
OR context_cpe_id IN (allowed_cpe_ids)
OR NOT EXISTS (sbom_has_cpes)
Adapted to 0.4.z: uses sbom_package_purl_ref (0.4.z predates the sbom_node_purl_ref rename); the from_entity purl_status refactor from the upstream commits is a no-op here as 0.4.z has no inline CPE subqueries to extract.
This fix is functionally complete for what 0.4.z is capable of.
Summary by Sourcery
Constrain PURL product status queries to the relevant SBOM CPE context to prevent wrong-product matches.
Bug Fixes:
Enhancements:
Summary by Sourcery
Prevent incorrect product status matches by applying SBOM-specific CPE context filtering to PURL queries.
Bug Fixes:
Enhancements:
Build:
Chores: