Repository navigation
bug: fix spring-expression CVE-2022-22950 (Boot 1.5.4 -> 2.5.11) in UserFront - #603
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-2434828/ CVE-2022-22950 (spring-expression SpEL array-allocation DoS, medium) reported onUserFront/pom.xml:30(findingsfind-b3724ad0).spring-expressioncomes in throughspring-boot-starter-web->spring-webmvc, and its version is set by the Boot parent. Spring 4.3.x has no fix, so this follows Snyk's upgrade path: Boot parent1.5.4.RELEASE->2.5.11, which brings Spring Framework 5.3.17 (spring-expression5.3.17 clears the CVE).Major version bump (flagged): Boot 1.5 -> 2.5 / Spring 4.3 -> 5.3.
java.versionstays1.8. 2.5.11 is the smallest Boot line that clears the CVE (Boot 2.6.0–2.6.4 still ship Spring < 5.3.17). Code changes Boot 2 needs:AppointmentServiceImpl.findAppointment:appointmentDao.findOne(id)->appointmentDao.findById(id).orElse(null)(Spring Data 2CrudRepository).application.properties:spring.jpa.hibernate.use-new-id-generator-mappings = false. Without it, Boot 2 switchesGenerationType.AUTOto ahibernate_sequencetable, so existing MySQLAUTO_INCREMENTids would collide.UserFrontApplicationTests: JUnit 4@RunWith(SpringRunner)-> JUnit 5org.junit.jupiter.api.Test(Boot 2.4+spring-boot-starter-testdoesn't include the vintage engine).mysql:mysql-connector-javais still managed by Boot 2.5 (8.0.28), so the coordinates stay the same. Boot 2.5 still allows circular references, so theUserServiceImpl<->AccountServiceImplcycle needs no new property.Duplicate notice: open PR #186 (
devin/1790739500-spring-expression-cve-2022-22950) fixes the same CVE with Boot 2.7.18 +mysql-connector-j. #173 (Boot 2.7.10) also clears it. Only one should land. This PR is the smaller Snyk-path bump, opened per the one-PR-per-finding rule.Verification
api.snyk.ioare blocked, so neithermvnon the real pom norsnyk testcould run (snyk testfails withSNYK-CLI-0000). Before/after Snyk issue counts were therefore not measured. Expected effect: this issue (SNYK-JAVA-ORGSPRINGFRAMEWORK-2434828) goes away. A rescan once the network allows it should confirm.2.7.18(Spring 5.3.31),com.mysql:mysql-connector-jandallow-circular-references(both needed only on 2.6+). Results:mvn -o package: BUILD SUCCESS.dependency:treeshowsspring-webmvc 5.3.31 -> spring-expression 5.3.31.UserFrontApplicationTests.contextLoads(JUnit 5, via the JUnit Platform launcher against MySQL 5.7): 1/1 passed.java -jaragainst MySQL 5.7, then curl:/index200, signup 302, login 302 ->/userFront, deposit 125.50 / withdraw 25.50 -> balance 100.00, with bothprimary_transactionrows written.new SpelExpressionParser().parseExpression("new int[200000000]").getValue()ALLOCATED int[200000000]SpelEvaluationException: EL1075E: Array declares too many elements, exceeding the threshold of '262,144'Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/8d16f16d624e406388baecae9f2d527f
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/8d16f16d624e406388baecae9f2d527f?variant=devin
Devin Review