Skip to content

fix: resolve Dependabot security alerts and update Spring templates - #1319

Closed
bartveenstra wants to merge 3 commits into
mainfrom
fix/dependabot-alerts
Closed

bartveenstra wants to merge 3 commits into
mainfrom
fix/dependabot-alerts

Conversation

@bartveenstra

@bartveenstra bartveenstra commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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-scaffold used it for one call: the escapeJavascript Mustache lambda in BoatExample, which the boat-angular mocks template uses. It now uses StringEscapeUtils.ESCAPE_ECMASCRIPT from 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.
    • Two scaffold tests used org.apache.commons.lang.UnhandledException; they now use lang3's UncheckedException.
    • boat-maven-plugin declared 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).

    Template Change
    boat-spring spring-boot/pom-sb3.mustache Spring Boot 3.3.13 → 3.5.16, springdoc 2.6.0 → 2.8.17
    boat-spring spring-cloud/pom-sb3.mustache Spring Boot 3.3.13 → 3.5.16, Spring Cloud 2023.0.0 → 2025.0.3, springdoc 2.2.0 → 2.8.17
    boat-spring spring-http-interface/pom.mustache Spring Boot 3.3.13 → 3.5.16
    boat-spring spring-boot/pom-sb4.mustache Spring Boot 4.0.1 → 4.0.9, springdoc 2.6.0 → 3.0.3
    boat-spring spring-cloud/pom-sb4.mustache Spring Boot 4.0.1 → 4.0.9, Spring Cloud 2025.1.0 → 2025.1.4, springdoc 2.2.0 → 3.0.3, no longer pins spring-security-oauth2-client 6.1.1
    boat-spring spring-http-interface/pom-sb4.mustache Spring Boot 4.0.1 → 4.0.9
    boat-java restclient pom.mustache and build.gradle.mustache spring-web 6.1.21 → 6.2.19

    The companion versions follow each Boot line:

    • Spring Cloud 2025.0 is the release train for Boot 3.5 and 2025.1 for Boot 4.0; older trains fail Spring Cloud's compatibility check.
    • springdoc 2.8 is the line for Boot 3.5 (releases before 2.7 break on Spring Framework 6.2), and springdoc 3.0 for Boot 4.0.
    • The Boot 4 spring-cloud template 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:tree shows no commons-lang:commons-lang in any module.
  • Unit tests pass, including BoatAngularTemplatesTests, which generates mocks.
  • mvn -pl boat-maven-plugin -am verify -Dgpg.skip passes. That covers all plugin invoker integration tests, including the example project, which compiles and tests generated Spring code against Boot 3.5.16.
  • The boat-scaffold invoker tests pass. They build the 8 generated Boot 3 spring-boot projects against Boot 3.5.16 and springdoc 2.8.17.
  • Manual check of the other templates. I generated a project from each and built it with mvn package:
    • Boot 3 spring-cloud, Boot 3 spring-http-interface, Boot 4 spring-cloud and Boot 4 spring-http-interface build. The Boot 4 spring-cloud project resolves spring-core 7.0.10 and Spring Security 7.0.8 throughout.
    • restclient and Boot 4 spring-boot needed workarounds for the existing bugs below, and then build.
    • A generated Boot 3 spring-boot app starts on Boot 3.5.16 and serves /v3/api-docs.
    • A generated Boot 4 spring-boot app starts on Boot 4.0.9 and serves /v3/api-docs and Swagger UI through springdoc 3.0.3.

Existing bugs found, not fixed here

All of these happen with the old versions too.

  • boat-java restclient doesn't generate ServerConfiguration and ServerVariable, so the generated ApiClient doesn't compile. For the manual build, I copied the two classes from the upstream java generator.
  • Boot 4 spring-boot (pom-sb4.mustache) declares spring-boot-starter-restclient twice, at compile and test scope. Maven 3.10 rejects the generated pom; older Maven only warns. The generator also doesn't write ApiUtil, which the generated API interfaces use. For the manual build, I removed the duplicate and copied ApiUtil from the upstream spring generator.
  • boat-spring spring-http-interface with useSpringBoot3=true fails because the library has no pom-sb3.mustache.

Not changed

  • The Spring Boot 2 templates (pom.mustache in spring-boot and spring-cloud) stay on Boot 2.7.15 and Spring Framework 5.3. Spring Framework 5.3 has no open-source fix for these advisories.
  • The asyncapi integration-test module (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.

bartveenstra and others added 2 commits November 9, 2026 11:33
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]>
@bartveenstra bartveenstra changed the title fix: resolve open Dependabot security alerts fix: resolve Dependabot security alerts and generate on Spring Boot 3.5 Nov 9, 2026
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]>
@bartveenstra bartveenstra changed the title fix: resolve Dependabot security alerts and generate on Spring Boot 3.5 fix: resolve Dependabot security alerts and update Spring templates Nov 9, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@bartveenstra

Copy link
Copy Markdown
Contributor Author

Moved into #1318.

@bartveenstra
bartveenstra deleted the fix/dependabot-alerts branch November 9, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant