Repository navigation
bug: fix spring-web CVE-2024-38809 (ETag DoS) — Spring 5.3.39 via Boot 2.7.18 - #473
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes code-scan finding
sfind-cb41afa4/ SNYK-JAVA-ORGSPRINGFRAMEWORK-7687447 (CVE-2024-38809, ETagIf-Match/If-None-Matchparsing DoS) inUserFront/pom.xml.spring-boot-starter-web@1.5.4pulls inspring-web@4.3.9. The fix ships only in 5.3.38+, 6.0.23+ and 6.1.12+.Major bump, please review: Spring Boot 1.5.x can't run Spring 5. So the parent goes 1.5.4.RELEASE → 2.7.18, the last Boot 2.x release and the last one that supports Java 8.
<java.version>1.8</java.version>stays the same. Spring 6 / Boot 3 would need Java 17, which the remediation guidance rules out.I chose 5.3.39 rather than the minimum 5.3.38. It's the final OSS 5.3 patch, and in the same framework BOM unit it also clears CVE-2024-38808 (spring-expression).
Code and config changes the Boot 2 upgrade needs:
AppointmentServiceImpl.findAppointment:appointmentDao.findOne(id)→findById(id).orElse(null)(Spring Data 2.x API).application.properties:spring.main.allow-circular-references=true, becauseUserServiceImplandAccountServiceImpldepend on each other.spring.jpa.hibernate.use-new-id-generator-mappings=false, soGenerationType.AUTOkeeps using MySQL auto-increment.testWhileIdle/validationQuerysettings are replaced byspring.datasource.hikari.connection-test-query.UserFrontApplicationTests: JUnit 4 → JUnit 5, because Boot 2.7'sspring-boot-starter-testdoesn't include JUnit 4.Same recipe as the earlier PR #180 (sfind-c72b47e5). Both PRs fix this CVE, so only one should land. This one is opened separately because the new finding gets its own PR.
Verification
The automation network policy blocks Maven Central and api.snyk.io. Spring 5.3.39 jars and the surefire JUnit Platform provider aren't in the local Maven cache, so I verified offline with the cached 5.3.31 jars:
mvn -o dependency:treeon this pom resolves everyorg.springframework:*artifact to 5.3.39.mvn -o -Dspring-framework.version=5.3.31 test-compile: BUILD SUCCESS on Java 17, targeting 1.8.UserFrontApplicationTests.contextLoads, run through JUnit Platform Launcher 1.9.3 against MySQL 5.7: 1 test found, 1 successful, 0 failed.role(1,'ROLE_USER'), then ran these curl checks:GET /indexreturns 200.POST /signupreturns 302.POST /index) returns 302 to/userFront.POST /account/depositof 125 returns 302, and the DB shows a primary balance of 125.00 plus aFinishedtransaction.snyk test --file=UserFront/pom.xmlfails withSNYK-CLI-0000because api.snyk.io is unreachable. Expected after:spring-webresolves to 5.3.39, which is ≥ 5.3.38, so SNYK-JAVA-ORGSPRINGFRAMEWORK-7687447 should clear. Please re-run the Snyk scan on this branch to confirm.mvn test/packagewith the real 5.3.39 jars (not cached), and the AdminPortal against this backend.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/1293a16d546b45f1b2c2b25691997888
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/1293a16d546b45f1b2c2b25691997888?variant=devin