Repository navigation
bug: upgrade Spring Boot 1.5.4 -> 2.4.12 to fix spring-core CVE-2021-22096 - #555
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)".
|
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 Snyk
SNYK-JAVA-ORGSPRINGFRAMEWORK-2329097/ CVE-2021-22096 (spring-core log injection, medium) inUserFront/pom.xml, findingsfind-21bf41a4. spring-core 4.3.9 comes in through Boot 1.5.4. Nothing on the 4.3.x line fixes this CVE (affected:[,5.2.18)and[5.3.0,5.3.12)), so the fix is Snyk's upgrade path:This is a major bump (Boot 1.x -> 2.x). I picked 2.4.12 because it's the smallest Boot release whose managed Spring Framework clears the CVE.
java.versionstays1.8.Follow-up changes the Boot 2.4 line requires:
AppointmentServiceImpl.findAppointment:appointmentDao.findOne(id)->findById(id).orElse(null). Spring Data 2.x removedfindOne(ID).spring.jpa.hibernate.use-new-id-generator-mappings = false. Boot 2 changes the default to true, which would sendGenerationType.AUTOthrough ahibernate_sequencetable. With the old default, existingAUTO_INCREMENTschemas keep working and there are no PK collisions.UserFrontApplicationTestsmoved to JUnit 5 (org.junit.jupiter.api.Test, noSpringRunner). Boot 2.4'sspring-boot-starter-testno longer ships the vintage engine.mysql:mysql-connector-javacoordinates are unchanged because Boot 2.4 still manages them.Verification
api.snyk.io(network policy; access was requested but not granted). Somvn teston the exact 2.4.12 parent did not run, and neither did the Snyk re-scan, so there are no before/after issue counts. The expected result is 1 -> 0 for SNYK-JAVA-ORGSPRINGFRAMEWORK-2329097, since Snyk's own upgrade path isspring-boot-starter-test@2.4.12 > spring-core@5.3.12. Reviewers/CI should confirm withsnyk test --file=UserFront/pom.xml.com.mysql:mysql-connector-jandspring.main.allow-circular-references=true, which only Boot 2.6+ needs) against MySQL 5.7, JDK 17, PR sources unchanged:mvn -o test-compileOK.UserFrontApplicationTests.contextLoadspassed: 1 found, 1 successful, 0 failed.AUTO_INCREMENTids and nohibernate_sequencetable.POST /index) 302 ->/userFront200, thenPOST /account/deposit250 -> primary balance250.00plus a "Deposit to Primary Account" transaction row.Duplicates
Older PR #200 (branch
devin/1790739531-spring-core-cve-2021-22096, Boot 2.7.18) fixes the same CVE. #173 (Boot 2.7.10) also clears it. Only one of them should land. This PR was opened for the new finding per the one-ticket-one-PR rule.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/fed8f01c02e643a7aa820db97443a8dd
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/fed8f01c02e643a7aa820db97443a8dd?variant=devin
Devin Review