dependency-check / dependency-check/DependencyCheck

How are compile dependencies handled in dependency management?

Open
#4,036 7 comments 0 reactions 0 assignees View on GitHub
bug maven
Dominant language
Java
Stars
7.7k
Forks
1.4k
Avg merge
9d 22h
Merged PRs (30d)
13

Description

I'm not sure if I found a bug or if the behavior of the ODC is correct.

I have a Maven parent project that defines JUnit Jupiter Vintage 5.7.2 in Dependency Management. I've set the skipDependencyManagement flag and skipTestScope to false and I also see that the JUnit libs are being scanned. A CVE is not found.

```xml



org.junit.vintage
junit-vintage-engine
5.7.2
test



```
Result in Sonar:
![grafik](https://user-images.githubusercontent.com/57911568/151979014-840795d9-7586-4e8d-b899-0c60adbe2bd4.png)

But if I now use this parent in a pom and use the JUnit Jupiter Library explicitly, it tells me that there is a CVE-2020-15250 in JUnit 4.13 which is used by the Jupiter 5.7.2 as a compile dependency.

```xml


org.junit.vintage
junit-vintage-engine
test


```

https://search.maven.org/artifact/org.junit.vintage/junit-vintage-engine/5.7.2/jar

![grafik](https://user-images.githubusercontent.com/57911568/151980382-85188311-9519-4342-9359-236003b6639a.png)

So I can understand why he reported this to me. What I don't understand is why this is not recognized in my parent, although the Jupiter 5.7.2 was also scanned.

Or are compile dependencies only evaluated once they are actually used?
Or to put it another way: Why doesn't it recognize the CVE if the Jupiter Lib is "only" in Dependency Management?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.