Skip to content

Maven dependencies not resolved correctly during filesystem scan - properties #2145

Description

@mrjonstrong

Description

Trivy filesystem scan of a pom.xml with a properties section resolves the wrong version of the dependency. In this example jackson

What did you expect to happen?

Version of dependencies in properties section of pom.xml to be used when trivy lists the packages and looks for matching cves

What happened instead?

Older versions of dependencies used

Output of run with -debug:

For simplicity sake I have removed all but the jackson dependencies

trivy -d fs --security-checks vuln -f json --list-all-pkgs .
2022-05-17T14:22:30.208+0100	DEBUG	Severities: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
2022-05-17T14:22:30.248+0100	DEBUG	cache dir:  /Users/mrjonstrong/Library/Caches/trivy
2022-05-17T14:22:30.248+0100	DEBUG	DB update was skipped because the local DB is the latest
2022-05-17T14:22:30.248+0100	DEBUG	DB Schema: 2, UpdatedAt: 2022-05-17 12:06:28.847448335 +0000 UTC, NextUpdate: 2022-05-17 18:06:28.847447935 +0000 UTC, DownloadedAt: 2022-05-17 13:07:53.138275 +0000 UTC
2022-05-17T14:22:30.249+0100	DEBUG	Vulnerability type:  [os library]
2022-05-17T14:22:30.249+0100	DEBUG	No secret config detected: trivy-secret.yaml
2022-05-17T14:22:30.259+0100	DEBUG	Resolving com.fasterxml.jackson:jackson-bom:2.13.2.20220328...
2022-05-17T14:22:30.294+0100	DEBUG	Resolving com.fasterxml.jackson:jackson-bom:2.13.0...
2022-05-17T14:22:30.307+0100	DEBUG	Resolving com.fasterxml.jackson.core:jackson-databind:2.13.0...
2022-05-17T14:22:30.569+0100	DEBUG	Resolving com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.2...
2022-05-17T14:22:30.575+0100	DEBUG	Resolving com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.2...
2022-05-17T14:22:30.576+0100	DEBUG	Resolving com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.2...
2022-05-17T14:22:30.587+0100	DEBUG	Resolving com.fasterxml.jackson.core:jackson-annotations:2.13.0...
2022-05-17T14:22:30.615+0100	DEBUG	Resolving com.fasterxml.jackson.core:jackson-core:2.13.0...
2022-05-17T14:22:30.739+0100	DEBUG	OS is not detected.
2022-05-17T14:22:30.739+0100	DEBUG	Detected OS: unknown
2022-05-17T14:22:30.739+0100	INFO	Number of language-specific files: 1
2022-05-17T14:22:30.739+0100	INFO	Detecting pom vulnerabilities...
2022-05-17T14:22:30.739+0100	DEBUG	Detecting library vulnerabilities, type: pom, path: pom.xml

Output of trivy -v:

Version: 0.28.0
Vulnerability DB:
  Version: 2
  UpdatedAt: 2022-05-17 12:06:28.847448335 +0000 UTC
  NextUpdate: 2022-05-17 18:06:28.847447935 +0000 UTC
  DownloadedAt: 2022-05-17 13:07:53.138275 +0000 UTC

Additional details (base image name, container registry info...):

Maven dependency tree shows higher versions of jackson

mvn dependency:tree | grep jackson
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.2:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.2:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.2:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.2:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.13.2:compile
[INFO] |     \- com.fasterxml.jackson.core:jackson-core:jar:2.13.2:compile

pom.xml

Metadata

Metadata

Assignees

Labels

triage/supportIndicates an issue that is a support question.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions