Repository navigation
bug: fix CVE-2024-38827 in spring-security-core (4.2.3 -> 5.7.14) - #465
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
…5.4 -> 2.7.18, Java 1.8 kept)
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Author
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
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-c6c165d7(SnykSNYK-JAVA-ORGSPRINGFRAMEWORKSECURITY-8399269, CVE-2024-38827, medium). Spring Security did locale-dependenttoLowerCase()/toUpperCase()in authorization matching.UserFrontgets spring-security-core 4.2.3 throughspring-boot-starter-securityfrom the Boot 1.5.4 parent.Major bump (flagged): no 4.x or 5.x line below 5.7.14 has the fix, and Spring Security 5.7 needs Spring 5.3 / Boot 2.7. So the smallest upgrade that clears the issue while keeping Java 8 is:
The Boot 2.7 upgrade forces these follow-on changes:
mysql:mysql-connector-java→com.mysql:mysql-connector-j. Boot 2.7 manages only the new coordinates.SecurityConfig: the@Autowired configureGlobal(AuthenticationManagerBuilder)becomes@Override configure(AuthenticationManagerBuilder). On Boot 2.x the old version creates a circular bean reference withpasswordEncoder().AppointmentServiceImpl.findAppointment:findOne(id)→findById(id).orElse(null). This is the Spring Data 2.x API.spring.main.allow-circular-references=true.UserServiceImplandAccountServiceImplinject each other, and Boot 2.6+ refuses circular references by default.UserFrontApplicationTestsmoves to JUnit 5, because Boot 2.7'sspring-boot-starter-testdropped the vintage engine.Duplicate notice: this has the same diff as open PR #227 (CVE-2024-38827 from an earlier finding,
sfind-0e22b79f). Per the one-ticket-one-PR rule this is a separate PR. Only one of the two should land.Verification
The session's network allowlist blocks Maven Central and api.snyk.io. Because of that, the 5.7.14 jars couldn't be downloaded, and I used the cached 5.7.11 jars instead (same API as 5.7.14; 5.7.14 is a patch release on that line). The pom itself pins 5.7.14.
mvn -o -Dspring-security.version=5.7.11 test-compileon JDK 17 with--release 8: compiles.UserFrontApplicationTests.contextLoadsagainst MySQL 5.7, run through the JUnit Platform launcher because the surefire junit-platform provider isn't cached: 1 test found, 1 successful, 0 failed./userFront→ 302/index/index?error/userFront(200)/USERFRONTwhile anonymous → 302/index(still protected)100.00snyk test --file=UserFront/pom.xmlfails withSNYK-CLI-0000because api.snyk.io is unreachable. Before the fix the finding is reported on 4.2.3. After the fix the resolved version is 5.7.14, which is the advisory's first fixed version on the 5.7 line. Please confirm with a Snyk re-scan in CI.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/e789ac48191c4b74b2b73f0554d5a964
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/e789ac48191c4b74b2b73f0554d5a964?variant=devin
Devin Review