You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IIUC mvn checks dependency version without regard to scope.
it means that if you add test dependency (as example), transitive dependency of another dependency will use version of test dependency:
if (d.Scope!=""&&d.Scope!="compile"&&d.Scope!="runtime") ||d.Optional {
So for this example Trivy skips new test com.fasterxml.jackson.core:jackson-annotations:2.18.0 dependency (as test scope), and includes com.fasterxml.jackson.core:jackson-annotations:2.18.1 into report:
This is wrong behavior.
I am not sure about the right way:
(most likely case) we need to skip jackson-annotations as test dependency
we should use version 2.18.0 for jackson-annotations, because, UUIC, maven will use jackson-annotations:2.18.0 in package jackson-databind (I may be wrong)
Anyway, we need to analyze all scopes and resolve dependencies after that.
But we already added support for test scope (We are reverting these changes - because the running time on trivi has increased a lot)
We need to think how we can handle this case.
for example, mvn always downloads all required files before resolving dependencies. Maybe we can do something like this.
Description
IIUC
mvn
checks dependency version without regard to scope.it means that if you add test dependency (as example), transitive dependency of another dependency will use version of test dependency:
But Trivy parses only
import
,runtime
,compile
and empty scopes:trivy/pkg/dependency/parser/java/pom/parse.go
Line 430 in 57e24aa
So for this example Trivy skips new test
com.fasterxml.jackson.core:jackson-annotations:2.18.0
dependency (as test scope), and includescom.fasterxml.jackson.core:jackson-annotations:2.18.1
into report:This is wrong behavior.
I am not sure about the right way:
jackson-annotations
as test dependency2.18.0
forjackson-annotations
, because, UUIC, maven will usejackson-annotations:2.18.0
in packagejackson-databind
(I may be wrong)Anyway, we need to analyze all scopes and resolve dependencies after that.
But we already added support for
test
scope (We are reverting these changes - because the running time on trivi has increased a lot)We need to think how we can handle this case.
for example,
mvn
always downloads all required files before resolving dependencies. Maybe we can do something like this.@aquasecurity/trivy Do you have any ideas?
Discussed in #7836
The text was updated successfully, but these errors were encountered: