Skip to content

Commit aff27b8

Browse files
authored
fix: DH-21266: migrate lz4 dependency (#7528)
Fixes CVE-2025-12183 and CVE-2025-66566
1 parent 0b294b8 commit aff27b8

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

buildSrc/src/main/groovy/io.deephaven.java-common-conventions.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@ plugins {
44
id 'io.deephaven.java-license-conventions'
55
id 'io.deephaven.java-toolchain-conventions'
66
id 'io.deephaven.java-jar-conventions'
7+
id 'io.deephaven.java-resolution-conventions'
78
}
89

910
project.tasks.getByName('quick').dependsOn project.tasks.withType(JavaCompile)
1011

11-
configurations.all({ c ->
12+
configurations.configureEach({ c ->
1213
// Make dynamic versions illegal.
13-
c.dependencies.all({
14+
c.dependencies.configureEach({
1415
Dependency dep ->
1516
if (dep.version && dep.version.endsWith('+')) {
1617
throw new GradleException("Dynamic versions not allowed ($dep found in $path)")
1718
}
1819
})
19-
c.resolutionStrategy {
20-
cacheChangingModulesFor 0, 'seconds'
21-
}
2220
})
2321

2422
tasks.named(LifecycleBasePlugin.CLEAN_TASK_NAME) {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
plugins {
2+
id 'java'
3+
}
4+
5+
configurations.configureEach {
6+
resolutionStrategy {
7+
capabilitiesResolution {
8+
// There is a gradle bug with relocated artifacts that declare capabilities as conflicting with the artifact
9+
// they are relocated from:
10+
// https://github.com/gradle/gradle/issues/35916
11+
// https://github.com/gradle/gradle/issues/1256
12+
// https://github.com/yawkat/lz4-java/wiki/Gradle-and-org.lz4:lz4%E2%80%90java:1.8.1
13+
withCapability('org.lz4:lz4-java') {
14+
select(candidates.find { ((ModuleComponentIdentifier) it.id).group == 'at.yawk.lz4' })
15+
}
16+
}
17+
cacheChangingModulesFor 0, 'seconds'
18+
}
19+
}

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jsinterop = "2.0.2"
6464
# google is annoying, and have different versions released for the same groupId
6565
jsinterop-base = "1.0.3"
6666
logback = "1.5.23"
67-
lz4 = "1.8.0"
67+
lz4 = "1.10.2"
6868
mindrot = "0.4"
6969
nidi = "0.18.1"
7070
oshi = "5.8.3"
@@ -275,7 +275,7 @@ jsinterop-base = { module = "com.google.jsinterop:base", version.ref = "jsintero
275275

276276
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
277277

278-
lz4-java = { module = "org.lz4:lz4-java", version.ref = "lz4" }
278+
lz4-java = { module = "at.yawk.lz4:lz4-java", version.ref = "lz4" }
279279

280280
mindrot-jbcrypt = { module = "org.mindrot:jbcrypt", version.ref = "mindrot" }
281281

0 commit comments

Comments
 (0)