fix: correct Apache Derby group ID in purl generation - #5090
Open
Ankush-Pathak wants to merge 1 commit into
Open
fix: correct Apache Derby group ID in purl generation#5090Ankush-Pathak wants to merge 1 commit into
Ankush-Pathak wants to merge 1 commit into
Conversation
Apache Derby artifacts use the group ID org.apache.derby, but their jars are OSGi bundles that ship no pom metadata. syft's manifest heuristic then picks up Bundle-Activator (org.apache.derby.osgi.EmbeddedActivator) as the group ID, producing an incorrect purl like pkg:maven/org.apache.derby.osgi.EmbeddedActivator/derby@10.16.1.1 instead of pkg:maven/org.apache.derby/derby@10.16.1.1. The bad group ID prevents grype from matching Maven/GHSA advisories such as GHSA-rcjc-c4pj-xxrp (CVE-2022-46337). Add the Derby artifacts to the DefaultArtifactIDToGroupID map so the known package list takes precedence over the manifest heuristic: - derby - derbyclient - derbynet - derbyoptionaltools - derbyshared - derbytools Signed-off-by: Ankush Pathak <ankush.pathak@chainguard.dev>
Ankush-Pathak
marked this pull request as ready for review
July 23, 2026 17:03
Author
|
@wagoodman could you approve the workflows? |
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.
Description
Apache Derby jars (
derby,derbyshared,derbytools, …) are OSGi bundles that ship nopom.properties/pom.xml. With no pom metadata, syft falls through to the manifest heuristic (groupIDFromJavaManifest), which walksPrimaryJavaManifestGroupIDFieldsand returns the first value starting with a TLD prefix. For Derby that isBundle-Activator: org.apache.derby.osgi.EmbeddedActivator(Bundle-SymbolicName: derbyis skipped because it has no TLD prefix).The result is a wrong purl:
pkg:maven/org.apache.derby.osgi.EmbeddedActivator/derby@10.16.1.1pkg:maven/org.apache.derby/derby@10.16.1.1Because the group ID is wrong, downstream matchers (e.g. grype's Maven/GHSA matcher, which does not use CPEs for Java by default) fail to match advisories like
GHSA-rcjc-c4pj-xxrp/CVE-2022-46337(Critical), even though the jar is clearly the affectedorg.apache.derby:derby.This adds the Derby artifacts to
DefaultArtifactIDToGroupIDso the known-package-list step (which runs before the manifest heuristic) supplies the correct group ID. All six are published underorg.apache.derbyon Maven Central.Validation
Built syft with this change and cataloged real Derby jars from Maven Central:
derby-10.16.1.1.jar(vulnerable)pkg:maven/org.apache.derby/derby@10.16.1.1GHSA-rcjc-c4pj-xxrp(Critical) — previously missedderby-10.17.1.0.jar(fixed, latest)pkg:maven/org.apache.derby/derby@10.17.1.0Before the fix the purl was
pkg:maven/org.apache.derby.osgi.EmbeddedActivator/derby@…; the strayapache:EmbeddedActivator/apache:osgiCPE candidates are also gone. For jars that do embed pom metadata the pom-based steps still take precedence, so the map entry only applies when the coordinates are otherwise unavailable.Type of change