Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions syft/pkg/cataloger/internal/cpegenerate/java_groupid_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -1921,4 +1921,16 @@ var DefaultArtifactIDToGroupID = map[string]string{
"kafka_2.8.2": "org.apache.kafka",
"kafka_2.9.1": "org.apache.kafka",
"kafka_2.9.2": "org.apache.kafka",

// legacy "Jackson 1.x" (aka "jackson-asl") artifacts predate the convention of embedding
// META-INF/maven/.../pom.properties in the jar, so groupIDFromKnownPackageList is the only
// way to recover the correct group ID for jars built without that metadata (e.g. Ant-built
// jars from before ~2014). Without this, the group ID falls back to the artifact name itself,
// producing purls that do not match the vulnerability database's namespace.
// See https://github.com/anchore/syft/issues/4598
"jackson-core-asl": "org.codehaus.jackson",
"jackson-mapper-asl": "org.codehaus.jackson",
"jackson-jaxrs": "org.codehaus.jackson",
"jackson-xc": "org.codehaus.jackson",
"jackson-smile": "org.codehaus.jackson",
}
17 changes: 17 additions & 0 deletions syft/pkg/cataloger/java/package_url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,23 @@ func Test_groupIDFromJavaMetadata(t *testing.T) {
metadata: pkg.JavaArchive{},
expect: "org.springframework.ldap",
},
{
// regression for github.com/anchore/syft/issues/4598: legacy Jackson 1.x ("-asl")
// jars built before ~2014 have no embedded pom.properties, so without the known
// package list the group ID falls back to the artifact name itself, producing a
// purl that doesn't match the vulnerability database's namespace (e.g. the correct
// group for jackson-mapper-asl is org.codehaus.jackson, not jackson-mapper-asl).
name: "known package list jackson-mapper-asl",
pkgName: "jackson-mapper-asl",
metadata: pkg.JavaArchive{},
expect: "org.codehaus.jackson",
},
{
name: "known package list jackson-core-asl",
pkgName: "jackson-core-asl",
metadata: pkg.JavaArchive{},
expect: "org.codehaus.jackson",
},
{
name: "java manifest",
metadata: pkg.JavaArchive{
Expand Down
Loading