Repository navigation
bug(security): upgrade spring-security-web to 5.7.13 via Boot 2.7.18 (CVE-2024-38821) - #398
Open
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-d7d37c89— CVE-2024-38821 (SNYK-JAVA-ORGSPRINGFRAMEWORKSECURITY-8309135, CWE-862, critical), spring-security-web authorization bypass for static resources. It comes in throughspring-boot-starter-securityinUserFront/pom.xml.Spring Boot 1.5.4 pins Spring Security 4.2.3, and the 4.x line has no fix. The fixed releases are 5.7.13 / 5.8.15 / 6.2.7 / 6.3.4. This PR uses the smallest one that runs on Java 8: 5.7.13, on the last Java 8 Boot line.
<java.version>1.8</java.version>stays the same.Code changes required by Boot 2.x:
SecurityConfig: the@Autowired configureGlobal(AuthenticationManagerBuilder)became an@Override configure(AuthenticationManagerBuilder).AppointmentServiceImpl.findAppointment:findOne(id)becamefindById(id).orElse(null)(Spring Data 2.x).application.properties: addedspring.main.allow-circular-references=true. Without it the existingUserServiceImpl<->AccountServiceImplbean cycle fails to start on Boot 2.6+.UserFrontApplicationTestsmoved from JUnit 4 to JUnit 5. Boot 2.7'sspring-boot-starter-testhas no vintage engine.Per the scan's own note, the CVE is only exploitable in WebFlux apps. UserFront is servlet/MVC, so its real exposure is low, but the vulnerable artifact is now off the classpath.
Verification
Maven Central isn't reachable from the build VM and 5.7.13 isn't cached. All runs therefore used the cached 5.7.11 jars (
-Dspring-security.version=5.7.11). 5.7.11 to 5.7.13 is a patch-only change on the same branch, with the same API.mvn -o -Dspring-security.version=5.7.11 -DskipTests package(JDK 17,--release 8) succeeded.UserFrontApplicationTests.contextLoadsran through the JUnit Platform launcher (surefire's junit-platform provider isn't cached) againstmysql:5.7: 1/1 passed.mysql:5.7and ran the curl flow:/userFrontreturns 302 to/indexPOST /index) returns 302 to/userFront, and/userFrontthen returns 200/index?errorprimary_account.account_balance=100.00/css/main.cssreturns 200snyk testfails because api.snyk.io is blocked by the session network policy, so there is no before/after issue count. Before: this finding (1 critical, CVE-2024-38821). After (expected): resolved, since spring-security-web resolves to 5.7.13, which is outside every vulnerable range. Network access has been requested.Duplicates
Branch
devin/1790739499-spring-security-cve-2024-38821(earlier run) does the same migration but pins 5.8.16. Open PRs #184 / #227 also move to Boot 2.7.18 (5.7.11 / 5.7.14); #227's 5.7.14 also clears this CVE. Only one of these should land.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/6455c9185a8841e08ffe2f7440434503
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/6455c9185a8841e08ffe2f7440434503?variant=devin