Repository navigation
fix: upgrade UserFront to Spring Boot 2.7.18 to clear spring-security-core CVE-2022-22976 - #591
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…enerator-mappings=false)
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-9591c9e1/ SNYK-JAVA-ORGSPRINGFRAMEWORKSECURITY-5950401 (CVE-2022-22976, BCrypt cost 31 integer overflow skips all rounds).spring-security-core4.2.3 came in throughspring-boot-starter-securityfrom the Boot 1.5.4 parent. The vulnerable range is[3.1.0, 5.4.11), and Boot 1.x has no 5.x line, so the parent has to move to Boot 2.x.Major bump (flagged): parent
1.5.4.RELEASE -> 2.7.18, which brings Spring Security 5.7.11 (above the 5.4.11/5.5.7/5.6.4 fixes).<java.version>stays 1.8. I picked 2.7.18 over the smallest Snyk path (2.5.0) because it's the last OSS 2.x release and the only 2.x parent available in the offline build cache, so it's the one I could build and run. It also clears the other 4.2.x/Boot 1.5 CVEs.Code changes needed for Boot 2.7:
mysql:mysql-connector-java->com.mysql:mysql-connector-j(the 2.7 BOM no longer manages the old coordinates)SecurityConfig:@Autowired configureGlobal(...)->@Override configure(AuthenticationManagerBuilder)AppointmentServiceImpl:findOne(id)->findById(id).orElse(null)(Spring Data 2.x)application.properties:spring.main.allow-circular-references=true(UserServiceImplandAccountServiceImpldepend on each other, and Boot 2.6+ rejects that by default)application.properties:spring.jpa.hibernate.use-new-id-generator-mappings=false. Boot 1.5 mappedGenerationType.AUTOto MySQLAUTO_INCREMENT; Boot 2.x defaults to a newhibernate_sequencetable that starts at 1, so existing databases would get duplicate-key errors on the next insert. This keeps the old IDENTITY mapping.UserFrontApplicationTests: JUnit 4@RunWith(SpringRunner)-> JUnit 5The app itself never uses BCrypt cost 31 (
new BCryptPasswordEncoder(12, ...)), so this is a dependency-hygiene fix, not a live exploit.This duplicates the same Boot 2.7.18 recipe in open PRs #184 / #227 / #281, which were opened for other spring-security CVEs. It's a separate PR because each new finding gets its own PR. Only one of them should land.
Verification (JDK 17,
mvn -o)mvn -o -DskipTests packagebuilds.dependency:tree -Dincludes=org.springframework.security: beforespring-security-core:4.2.3.RELEASE(from the finding / Boot 1.5.4 BOM), afterspring-security-{config,core,crypto,web}:5.7.11.UserFrontApplicationTests.contextLoadspasses against MySQL 5.7 (1/1 successful). I ran it through the JUnit Platform launcher 1.9.3 because the surefire junit-platform provider isn't in the offline cache./index?error, login ->/userFront200, deposit of 125 persisted (primary_account.account_balance=125.00), anonymous/userFront->/index, and stored hashes are$2a$12$.primary_accountrow id 500: nohibernate_sequencetable is created, and signup + deposit assignprimary_accountid 501 (auto_increment continues after the existing rows).Snyk before/after
Not measured.
snyk testfails withSNYK-CLI-0000because api.snyk.io is blocked by this session's network policy. Going by the dependency tree, the finding count for this issue should drop from 1 to 0, since 5.7.11 is outside[3.1.0, 5.4.11). Please re-run the Snyk scan in CI to confirm.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/006860877b8f4d88b1d57b6d7584d9c3
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/006860877b8f4d88b1d57b6d7584d9c3?variant=devin
Devin Review