Repository navigation
fix: resolve Dependabot security alerts and update Spring templates - #1319
Closed
bartveenstra wants to merge 3 commits into
Closed
bartveenstra wants to merge 3 commits into
bartveenstra wants to merge 3 commits into
Conversation
Replace commons-lang 2.6 (GHSA-j288-q9x7-2f5v) with commons-text in boat-scaffold and drop the unused dependency from boat-maven-plugin. Bump Spring Boot to 3.5.16 and spring-core to 6.2.19 in the plugin IT example (GHSA-jmp9-x22r-554x, GHSA-659m-px2c-25wj). Co-authored-by: Cursor <[email protected]>
The boat-spring templates generated projects on Spring Boot 3.3.13, which brings the vulnerable spring-core 6.1. They now use Spring Boot 3.5.16 with the matching Spring Cloud 2025.0.3 train and springdoc 2.8.17, since older springdoc releases fail on Spring Framework 6.2. The boat-java restclient templates use spring-web 6.2.19. Co-authored-by: Cursor <[email protected]>
Spring Boot 4.0.1 brings spring-core 7.0.2, which is affected by GHSA-659m-px2c-25wj. The Spring Boot 4 templates now use Spring Boot 4.0.9 with Spring Cloud 2025.1.4 and springdoc 3.0.3, the springdoc line for Spring Boot 4. The spring-cloud template no longer pins spring-security-oauth2-client 6.1.1, so Spring Boot manages it with the rest of Spring Security 7. Co-authored-by: Cursor <[email protected]>
|
Contributor
Author
|
Moved into #1318. |
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 the four open Dependabot alerts on
main, and updates the Spring generator templates so generated projects no longer get the vulnerable Spring Framework versions either.Changes
commons-lang 2.6 (GHSA-j288-q9x7-2f5v, alerts Release 0.2.1 #31 and Feature/return of the diff #30). commons-lang 2.x is end of life and has no fixed version.
boat-scaffoldused it for one call: theescapeJavascriptMustache lambda inBoatExample, which theboat-angularmocks template uses. It now usesStringEscapeUtils.ESCAPE_ECMASCRIPTfrom commons-text 1.14.0, the version the plugin already resolves. The commons-lang3 equivalent is deprecated in favour of commons-text. The escaped output is the same as commons-lang 2.6 for quotes, backslashes,/, control characters and non-ASCII characters.org.apache.commons.lang.UnhandledException; they now use lang3'sUncheckedException.boat-maven-plugindeclared commons-lang without using it, so the dependency is removed.spring-core 6.1.21 (GHSA-jmp9-x22r-554x, GHSA-659m-px2c-25wj, alerts Master #33 and Release 0.2.4 #38). In the plugin integration-test example (
boat-maven-plugin/src/it/example/pom.xml), Spring Boot goes from 3.3.13 to 3.5.16 and spring-core from 6.1.21 to 6.2.19.Generator templates. The templates were unchanged copies of upstream openapi-generator 7.20 and generated projects on vulnerable versions: Spring Boot 3.3.13 brings spring-core 6.1.21, and Spring Boot 4.0.1 brings spring-core 7.0.2, which is affected by GHSA-659m-px2c-25wj (fixed in 7.0.8).
boat-springspring-boot/pom-sb3.mustacheboat-springspring-cloud/pom-sb3.mustacheboat-springspring-http-interface/pom.mustacheboat-springspring-boot/pom-sb4.mustacheboat-springspring-cloud/pom-sb4.mustachespring-security-oauth2-client6.1.1boat-springspring-http-interface/pom-sb4.mustacheboat-javarestclientpom.mustacheandbuild.gradle.mustacheThe companion versions follow each Boot line:
spring-cloudtemplate pinned the Spring Security 6.1 oauth2 client next to Boot 4's Spring Security 7. It now leaves the version to Spring Boot, as the Boot 3 template already did.Testing
mvn dependency:treeshows nocommons-lang:commons-langin any module.BoatAngularTemplatesTests, which generates mocks.mvn -pl boat-maven-plugin -am verify -Dgpg.skippasses. That covers all plugin invoker integration tests, including theexampleproject, which compiles and tests generated Spring code against Boot 3.5.16.boat-scaffoldinvoker tests pass. They build the 8 generated Boot 3spring-bootprojects against Boot 3.5.16 and springdoc 2.8.17.mvn package:spring-cloud, Boot 3spring-http-interface, Boot 4spring-cloudand Boot 4spring-http-interfacebuild. The Boot 4spring-cloudproject resolves spring-core 7.0.10 and Spring Security 7.0.8 throughout.restclientand Boot 4spring-bootneeded workarounds for the existing bugs below, and then build.spring-bootapp starts on Boot 3.5.16 and serves/v3/api-docs.spring-bootapp starts on Boot 4.0.9 and serves/v3/api-docsand Swagger UI through springdoc 3.0.3.Existing bugs found, not fixed here
All of these happen with the old versions too.
boat-javarestclientdoesn't generateServerConfigurationandServerVariable, so the generatedApiClientdoesn't compile. For the manual build, I copied the two classes from the upstreamjavagenerator.spring-boot(pom-sb4.mustache) declaresspring-boot-starter-restclienttwice, at compile and test scope. Maven 3.10 rejects the generated pom; older Maven only warns. The generator also doesn't writeApiUtil, which the generated API interfaces use. For the manual build, I removed the duplicate and copiedApiUtilfrom the upstreamspringgenerator.boat-springspring-http-interfacewithuseSpringBoot3=truefails because the library has nopom-sb3.mustache.Not changed
pom.mustacheinspring-bootandspring-cloud) stay on Boot 2.7.15 and Spring Framework 5.3. Spring Framework 5.3 has no open-source fix for these advisories.boat-maven-plugin/src/it/example/boat-generate/asyncapi/pom.xml) still imports the Boot 3.3.13 and Spring Cloud 2023.0.5 BOMs. It resolves spring-core 6.2.19 through the parent pin.