Skip to content

Commit ade5a09

Browse files
sundancekid73claude
andcommitted
deps(phase1): close CVEs and upgrade build tooling
- Jackson all modules 2.9.10 → 2.17.3 (via BOM override): closes CVE-2020-25649 XXE, CVE-2021-46877 DoS, CVE-2022-42003/42004 DoS, CVE-2025-52999 StackOverflow - Log4j2 2.16.0 → 2.24.3: closes CVE-2021-45105 infinite recursion - commons-compress forced 1.24.0 → 1.27.1: closes CVE-2024-25710, CVE-2024-26308 (transitive via TestContainers) - Lombok 1.18.22 → 1.18.38 - JUnit Jupiter 5.7.1 → 5.11.4 (umbrella; individual modules pinned by Boot BOM until Phase 2) - TestContainers 1.20.1 → 1.20.6 - JaCoCo 0.8.7 → 0.8.13 - com.palantir.docker plugin 0.26.0 → 0.36.0 - com.gradle.enterprise plugin 3.5.1 → 3.16.2 - Gradle wrapper 6.8 → 7.6.4 - Fix Gradle 7 deprecations: testCompile → testImplementation, xml.enabled → xml.required; remove redundant default sourceSets block - KeywordDeserializer: replace javax.xml.bind.DatatypeConverter (removed from JDK 9+) with java.time.OffsetDateTime Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 14e3815 commit ade5a09

4 files changed

Lines changed: 25 additions & 33 deletions

File tree

build.gradle

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'org.springframework.boot' version '2.4.5'
3-
id 'com.palantir.docker' version '0.26.0'
3+
id 'com.palantir.docker' version '0.36.0'
44
id "io.spring.dependency-management" version "1.0.11.RELEASE"
55
id 'java'
66
id 'jacoco'
@@ -11,17 +11,17 @@ version = '2.3.0'
1111
sourceCompatibility = '11'
1212

1313
ext {
14-
jacksonVersion = '2.9.10'
15-
junitVersion = '5.7.1'
14+
junitVersion = '5.11.4'
1615
keycloakVersion = '6.0.1'
17-
lombokVersion = '1.18.22'
16+
lombokVersion = '1.18.38'
1817
springBootVersion = '2.4.5'
1918
springSecurityVersion = '5.4.6'
20-
testContainersVersion = '1.20.1'
19+
testContainersVersion = '1.20.6'
2120
swaggerVersion = '2.9.2'
2221
}
2322

24-
ext['log4j2.version'] = '2.16.0'
23+
ext['jackson.version'] = '2.17.3'
24+
ext['log4j2.version'] = '2.24.3'
2525

2626
configurations {
2727
developmentOnly
@@ -31,6 +31,14 @@ configurations {
3131
compileOnly {
3232
extendsFrom annotationProcessor
3333
}
34+
configureEach {
35+
resolutionStrategy.eachDependency { details ->
36+
if (details.requested.group == 'org.apache.commons' && details.requested.name == 'commons-compress') {
37+
details.useVersion '1.27.1'
38+
details.because 'CVE-2024-25710, CVE-2024-26308 fixed in 1.26.0'
39+
}
40+
}
41+
}
3442
}
3543

3644
repositories {
@@ -41,24 +49,6 @@ springBoot {
4149
buildInfo()
4250
}
4351

44-
sourceSets {
45-
main {
46-
java {
47-
srcDir 'src/main/java'
48-
}
49-
resources {
50-
srcDir 'src/main/resources'
51-
}
52-
}
53-
test {
54-
java {
55-
srcDir 'src/test/java'
56-
}
57-
resources {
58-
srcDir 'src/test/resources'
59-
}
60-
}
61-
}
6252

6353
test {
6454
useJUnitPlatform()
@@ -67,14 +57,14 @@ test {
6757
}
6858

6959
jacoco {
70-
toolVersion = "0.8.7"
60+
toolVersion = "0.8.13"
7161
}
7262

7363
jacocoTestReport {
7464
dependsOn test
7565
reports {
76-
xml.enabled true
77-
html.enabled true
66+
xml.required = true
67+
html.required = true
7868
}
7969
}
8070

@@ -92,7 +82,7 @@ dependencies {
9282
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
9383

9484
// Jackson
95-
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jacksonVersion}"
85+
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml"
9686

9787
// Swagger
9888
implementation "io.springfox:springfox-swagger2:${swaggerVersion}"
@@ -105,7 +95,7 @@ dependencies {
10595
testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
10696
testImplementation "org.springframework.security:spring-security-test:${springSecurityVersion}"
10797
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
108-
testCompile "org.testcontainers:junit-jupiter:${testContainersVersion}"
98+
testImplementation "org.testcontainers:junit-jupiter:${testContainersVersion}"
10999
}
110100

111101
dependencyManagement {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pluginManagement {
55
}
66

77
plugins {
8-
id 'com.gradle.enterprise' version '3.5.1'
8+
id 'com.gradle.enterprise' version '3.16.2'
99
}
1010

1111
gradleEnterprise {

src/main/java/net/gendercomics/api/model/jackson/KeywordDeserializer.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
77
import net.gendercomics.api.model.*;
88

9-
import javax.xml.bind.DatatypeConverter;
109
import java.io.IOException;
10+
import java.time.OffsetDateTime;
11+
import java.time.format.DateTimeFormatter;
1112
import java.util.*;
1213

1314
public class KeywordDeserializer extends StdDeserializer<Keyword> {
@@ -61,7 +62,8 @@ public Keyword deserialize(JsonParser jp, DeserializationContext ctxt) throws IO
6162
}
6263

6364
private Date dateFromJson(JsonNode json, String nodeName) {
64-
return json.get(nodeName).asText().equals("null") ? null : DatatypeConverter.parseDateTime(json.get(nodeName).asText()).getTime();
65+
return json.get(nodeName).asText().equals("null") ? null :
66+
Date.from(OffsetDateTime.parse(json.get(nodeName).asText(), DateTimeFormatter.ISO_OFFSET_DATE_TIME).toInstant());
6567
}
6668

6769
private String valueFromJson(JsonNode json, String nodeName) {

0 commit comments

Comments
 (0)