Laurence Gonsalves
04/12/2024, 9:32 PMLaurence Gonsalves
04/12/2024, 9:33 PMdependencies {
constraints {
api("com.graphql-java:graphql-java") {
version {
strictly("[20.4,)")
prefer("20.4")
}
because("CVE-2023-2976")
}
}
However, just now I noticed that the above constraint was somehow causing graphql-java to get downgraded to 20.4. From the output of ./gradlew dependencies
, this was in runtimeClasspath with this constraint:
| +--- com.expediagroup:graphql-kotlin-schema-generator:7.1.0
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 1.9.23 (*)
| | +--- org.jetbrains.kotlin:kotlin-reflect:1.8.22 -> 1.9.23 (*)
| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.7.3 -> 1.8.0 (*)
| | +--- io.github.classgraph:classgraph:4.8.170
| | +--- org.slf4j:slf4j-api:2.0.12 -> 2.0.13
| | +--- com.graphql-java:graphql-java:21.5 -> 20.4
| | | +--- com.graphql-java:java-dataloader:3.2.0 -> 3.2.2
I though this constraint would only ever push the dependency forward, not back, but the line com.graphql-java:graphql-java:21.5 -> 20.4
suggests otherwise, and indeed when I removed the constraint it caused me to get a newer version of graphql-java.Laurence Gonsalves
04/12/2024, 9:34 PMChris
04/12/2024, 9:38 PMversion {
require("20.4")
}
require
Implies that the selected version cannot be lower than whataccepts but could be higher through conflict resolution, even if higher has an exclusive higher bound. This is what a direct dependency translates to. This term supports dynamic versions.require
When defined, this overrides any previousIsn’t that what you want?declaration and clears previousstrictly
.reject
Laurence Gonsalves
04/12/2024, 9:48 PM```dependencies {
constraints {
implementation("org.apache.logging.log4j:log4j-core") {
version {
strictly("[2.17, 3[")
prefer("2.17.0")
}
```
Laurence Gonsalves
04/12/2024, 9:49 PMLaurence Gonsalves
04/12/2024, 9:53 PMversion {
strictly("[20.4, 21[")
prefer("20.4")
}
Chris
04/12/2024, 9:53 PMChris
04/12/2024, 9:54 PMThomas Broyer
04/12/2024, 9:54 PMrequire 2.17.1; reject [2.0, 2.17.1)
for log4j.Chris
04/12/2024, 9:54 PMdependencyInsight
have to say?Laurence Gonsalves
04/12/2024, 9:56 PMLaurence Gonsalves
04/12/2024, 9:58 PMFwiw, Gradle apparently usesOof. Perhaps someone should update https://blog.gradle.org/log4j-vulnerability?for log4jrequire 2.17.1; reject [2.0, 2.17.1)
Laurence Gonsalves
04/12/2024, 10:06 PMdependencyInsight
on --configuration runtimeClasspath --dependency com.graphql-java:graphql-java
and it says... a bunch of stuff.
I've never heard of dependencyInsight before, so I'm not familiar with how to interpret its output. 😆
What should I be looking for?Laurence Gonsalves
04/12/2024, 10:16 PMapi("com.graphql-java:graphql-java") {
version {
require("20.4")
reject("[20.0, 20.4)")
}
because("CVE-2023-2976")
}
I'm curious to know if the added reject
clause here provides any safety over having only the require
clause.Chris
04/13/2024, 2:57 PMLaurence Gonsalves
04/16/2024, 5:52 PM