Skip to content

Commit d87498c

Browse files
committed
Upgrade libraries to fix security issues
1 parent 6c8d41b commit d87498c

File tree

3 files changed

+28
-23
lines changed

3 files changed

+28
-23
lines changed

build.gradle

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,24 @@ subprojects {
6464
testCompileOnly(libs.lombok)
6565
testAnnotationProcessor(libs.lombok)
6666

67-
// Security constraints
68-
constraints {
69-
implementation("ch.qos.logback:logback-core:1.5.15") {
70-
because("versions below 1.5.15 have security vulnerabilities - see dependabot #7, #6")
71-
}
72-
implementation("ch.qos.logback:logback-classic:1.5.15") {
73-
because("versions below 1.5.15 have security vulnerabilities - see dependabot #7, #6")
74-
}
75-
implementation("org.springframework:spring-web:6.2.8") {
76-
because("versions below 6.2.8 have security vulnerabilities including CVE-2024-38820 - see dependabot #12")
77-
}
78-
implementation("org.apache.tomcat.embed:tomcat-embed-core:10.1.42") {
79-
because("versions below 10.1.42 have security vulnerabilities including CVE-2024-56337 - see dependabot #13")
67+
// Security constraints - force minimum versions for vulnerable dependencies
68+
def enforceMinVersion = { groupId, artifactId, minVersion, reason ->
69+
return { details ->
70+
if (details.requested.group == groupId && details.requested.name == artifactId) {
71+
def parse = { String v -> v.tokenize('.').collect { it.padLeft(3, '0') }.join() }
72+
def current = parse(details.requested.version)
73+
def minimum = parse(minVersion)
74+
if (current < minimum) {
75+
details.useVersion minVersion
76+
details.because reason
77+
}
78+
}
8079
}
8180
}
81+
configurations.configureEach {
82+
resolutionStrategy.eachDependency enforceMinVersion('org.springframework', 'spring-web', '6.2.8', 'versions below 6.2.8 have security vulnerabilities including CVE-2024-38820 - see dependabot #12')
83+
resolutionStrategy.eachDependency enforceMinVersion('org.apache.tomcat.embed', 'tomcat-embed-core', '10.1.42', 'versions below 10.1.42 have security vulnerabilities including CVE-2024-56337 - see dependabot #13')
84+
}
8285
}
8386

8487
checkstyle {

examples/example-spring-boot-starter-web/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ plugins {
66
}
77

88
// Needed for security. See:
9-
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/7
10-
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/6
11-
// Hopefully with spring-boot 3.4.2+ this won't be needed anymore and can be removed.
9+
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/13
10+
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/14
11+
// Hopefully with spring-boot 3.5.0+ this won't be needed anymore and can be removed.
1212
dependencyManagement {
1313
dependencies {
14-
dependency 'ch.qos.logback:logback-core:1.5.18'
15-
dependency 'ch.qos.logback:logback-classic:1.5.18'
14+
dependency 'org.apache.tomcat.embed:tomcat-embed-core:10.1.42'
15+
dependency 'org.apache.tomcat.embed:tomcat-embed-el:10.1.42'
16+
dependency 'org.apache.tomcat.embed:tomcat-embed-websocket:10.1.42'
1617
}
1718
}
1819

examples/example-spring-boot-starter-webflux/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ plugins {
66
}
77

88
// Needed for security. See:
9-
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/7
10-
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/6
11-
// Hopefully with spring-boot 3.4.2+ this won't be needed anymore and can be removed.
9+
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/13
10+
// - https://github.com/getyourguide/openapi-validation-java/security/dependabot/14
11+
// Hopefully with spring-boot 3.5.0+ this won't be needed anymore and can be removed.
1212
dependencyManagement {
1313
dependencies {
14-
dependency 'ch.qos.logback:logback-core:1.5.18'
15-
dependency 'ch.qos.logback:logback-classic:1.5.18'
14+
dependency 'org.apache.tomcat.embed:tomcat-embed-core:10.1.42'
15+
dependency 'org.apache.tomcat.embed:tomcat-embed-el:10.1.42'
16+
dependency 'org.apache.tomcat.embed:tomcat-embed-websocket:10.1.42'
1617
}
1718
}
1819

0 commit comments

Comments
 (0)