Fix Snyk vulnerabilities: upgrade to Spring Boot 2.7.18 and patch managed dependencies - #1060
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
Co-Authored-By: shayan <shayan@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:
|
Comment on lines
+27
to
+41
| // The Spring Boot BOM manages graphql-java for spring-graphql; DGS needs a newer version. | ||
| ext['graphql-java.version'] = '19.11' | ||
|
|
||
| // Patch releases of BOM-managed libraries that carry security fixes not yet | ||
| // picked up by the Spring Boot 2.7.x line. | ||
| ext['tomcat.version'] = '9.0.121' | ||
| ext['spring-framework.version'] = '5.3.39' | ||
| ext['spring-security.version'] = '5.8.16' | ||
| ext['jackson-bom.version'] = '2.18.10' | ||
| ext['kotlin.version'] = '1.9.25' | ||
| ext['logback.version'] = '1.2.13' | ||
| ext['snakeyaml.version'] = '2.4' | ||
| ext['reactor-bom.version'] = '2020.0.47' | ||
| ext['commons-lang3.version'] = '3.18.0' | ||
| ext['assertj.version'] = '3.27.7' |
Author
| ext['jackson-bom.version'] = '2.18.10' | ||
| ext['kotlin.version'] = '1.9.25' | ||
| ext['logback.version'] = '1.2.13' | ||
| ext['snakeyaml.version'] = '2.4' |
Author
There was a problem hiding this comment.
Comment on lines
+27
to
+28
| // The Spring Boot BOM manages graphql-java for spring-graphql; DGS needs a newer version. | ||
| ext['graphql-java.version'] = '19.11' |
Author
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
Moves the dependency tree off end-of-life Spring Boot 2.6.3 to 2.7.18 and pins security patch releases of BOM-managed libraries that the 2.7.x BOM has frozen (2.7.x is itself EOL, so the BOM ships old Tomcat/Jackson/Spring Framework patch levels).
Snyk Open Source (unique issue/package pairs,
snyk test --all-projects):(Snyk's UI counts vulnerable paths, which is where the 53 critical / 258 high in the ticket comes from; the ratio of the reduction is the same.)
Two non-obvious pieces in
build.gradle:DGS stays on the 5.x line (
4.9.21->5.6.2): DGS 6.x+ publishes Java-17-only variants and this project targets Java 11, so it is not resolvable here.Vulnerabilities fixed (by package)
Fixed by the Boot 2.7.18 upgrade + pinned patch versions:
org.apache.tomcat.embed:tomcat-embed-core9.0.56 -> 9.0.121 — 26 vulns, all gone (incl. criticals SNYK-JAVA-ORGAPACHETOMCATEMBED-* RCE/request smuggling)org.apache.tomcat.embed:tomcat-embed-websocket9.0.56 -> 9.0.121 — 1 highcom.fasterxml.jackson.core:jackson-databind/jackson-core2.13.1 -> 2.18.10 — 8 vulns, all goneorg.springframework:spring-beans5.3.15 -> 5.3.39 — critical RCE SNYK-JAVA-ORGSPRINGFRAMEWORK-2436751 (Spring4Shell-adjacent) fixedorg.springframework:spring-webmvc/spring-web/spring-core/spring-expression5.3.15 -> 5.3.39 — 11 of 19 fixedorg.springframework.security:spring-security-web/-core/-config/-crypto5.6.1 -> 5.8.16 — 6 of 10 fixed (incl. authorization-bypass SNYK-JAVA-ORGSPRINGFRAMEWORKSECURITY-2833359, missing-authorization SNYK-JAVA-ORGSPRINGFRAMEWORKSECURITY-8309135)org.springframework.boot:spring-boot-autoconfigure/spring-boot2.6.3 -> 2.7.18 — 2 of 5 fixedorg.yaml:snakeyaml1.30 -> 2.4 — incl. critical deserialization SNYK-JAVA-ORGYAML-*ch.qos.logback:logback-core/-classic1.2.10 -> 1.2.13 — 4 of 5 fixedio.projectreactor:reactor-core3.4.14 -> 3.4.41,org.apache.commons:commons-lang33.12.0 -> 3.18.0,org.assertj:assertj-core3.22.0 -> 3.27.7 (test only),org.jetbrains.kotlin:kotlin-stdlib1.6.10 -> 1.9.25,com.google.guava(via DGS 5.6.2)org.xerial:sqlite-jdbc3.36.0.3 -> 3.41.2.2 — arbitrary code execution SNYK-JAVA-ORGXERIAL-5596891com.google.protobuf:protobuf-java3.9.0 -> 3.25.8 — stack overflow SNYK-JAVA-COMGOOGLEPROTOBUF-8055227 (added as a direct dependency because it only arrives transitively through Apollo federation support)Snyk Code: CSRF protection disabled (CWE-352),
WebSecurityConfig.java:38— not changed, comment addedLeft
csrf().disable()in place; added a comment stating why. This API is stateless:SessionCreationPolicy.STATELESS, no session or auth cookie is ever issued, andJwtTokenFilterauthenticates each request solely from theAuthorization: Token <jwt>header. Browsers do not attach that header to cross-site requests, so there is no ambient credential for an attacker to ride on — the precondition for CSRF does not hold. CORS is also configured withsetAllowCredentials(false). Enabling CSRF would require every client (including the RealWorld reference frontends) to fetch and echo a token, breaking the published API contract for no security gain.Deliberately NOT fixed
fixedInfor every one of these is 6.x/7.x — i.e. they are only fixed on the Spring Boot 3.x / Framework 6.x line, which is unavailable to a Boot 2.7 app. Per the ticket, 3.x is left as a follow-up: it forcesjavax.*->jakarta.*, replaces the removedWebSecurityConfigurerAdapterused byWebSecurityConfig, and requires Java 17 + DGS 9.x — far beyond a minimal security patch.ch.qos.logback:logback-coreexpression injection (SNYK-JAVA-CHQOSLOGBACK-17675439) — fixed only in 1.5.36, which requires SLF4J 2.x and is incompatible with Boot 2.7's SLF4J 1.7.org.antlr:antlr4,org.apache.logging.log4j:log4j-api— Snyk reports no upgrade or patch available.src/test/**— test fixtures, not real credentials..snykignores or suppression comments were added.Note on unrelated diff hunk
src/test/java/io/spring/infrastructure/service/DefaultJwtServiceTest.javahas a 2-line reformat from./gradlew spotlessApply. ThatspotlessCheckviolation pre-exists onmaster(verified by stashing this branch's changes) and would otherwise make./gradlew buildfail on this branch.Validation
./gradlew build— BUILD SUCCESSFUL (68 tests,spotlessCheckincluded)snyk test --all-projects— counts in the table aboveLink to Devin session: https://app.devin.ai/sessions/1bdf2f6e71a54ff687cae6f9d7e1da0a
Open in Devin Desktop: https://app.devin.ai/desktop/session/1bdf2f6e71a54ff687cae6f9d7e1da0a?variant=devin
Requested by: @shayanshafii
Devin Review