fix(security): Patch Spring4Shell RCE — upgrade Spring Boot 2.2.6 → 2.7.18 [COG-423]#19
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
Conversation
…ell RCE [COG-423] Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
… loader is blocked Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
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
Remediates CVE-2022-22965 (Spring4Shell) — a critical (CVSS 9.8) Remote Code Execution vulnerability in
org.springframework:spring-beans@5.2.5.RELEASE, which was transitively pulled by Spring Boot 2.2.6.RELEASE.Root cause: Spring MVC data binding on JDK 9+ allowed attackers to manipulate
class.module.classLoaderproperties to achieve RCE by reaching Tomcat'sAccessLogValve. This vulnerability is actively exploited in the wild and listed in CISA's KEV catalog.Fix applied:
spring-boot-starter-parentfrom2.2.6.RELEASE→2.7.18inmonolith/pom.xml5.3.31(≥ 5.3.18 fix threshold), which restricts property access throughCachedIntrospectionResultsto block class loader traversalspring-boot-starter-validationas an explicit dependency (required since Spring Boot 2.3+ no longer bundles it inspring-boot-starter-web)Tests added (3 new tests):
Spring4Shell_ClassLoaderNotBindable_CVE_2022_22965— usesBeanWrapperImplto verifyclass.module.classLoaderis not reachable as a readable property (the exact mechanism patched in 5.3.18)Spring4Shell_ClassPropertyValueIsNull_CVE_2022_22965— attempts to resolveclass.module.classLoaderviagetPropertyValue()and asserts it throws or returns nullSpring4Shell_FrameworkVersionPatched_CVE_2022_22965— asserts the resolved Spring Framework version meets the minimum patched version (5.3.18+)Verification: All 10 tests pass (7 existing + 3 new).
spring-beansresolved to5.3.31.Review & Testing Checklist for Human
spring-beansversion in dependency tree is ≥ 5.3.18 (./mvnw dependency:tree | grep spring-beans)./mvnw clean test— all 10 tests should passspring-boot-starter-validationaddition doesn't change API behavior (validation annotations were already in the codebase, just missing the transitive dep)./mvnw spring-boot:run) and verify/bonds,/counterparties,/rfqsendpoints respond correctlyNotes
hibernate-validatorfromspring-boot-starter-web(addressed by addingspring-boot-starter-validation)pom.xml— all existing APIs, entities, and DTOs are fully compatible with Spring Boot 2.7Link to Devin session: https://app.devin.ai/sessions/1efea42db4f741119f3e7c0d6115954f
Requested by: @patrickbradley-cog
Devin Review