Skip to content

Java: Add Spring MVC URL redirect sinks - #22362

Open
theinfosecguy wants to merge 2 commits into
github:mainfrom
theinfosecguy:java-spring-mvc-redirect-sinks
Open

Java: Add Spring MVC URL redirect sinks#22362
theinfosecguy wants to merge 2 commits into
github:mainfrom
theinfosecguy:java-spring-mvc-redirect-sinks

Conversation

@theinfosecguy

@theinfosecguy theinfosecguy commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #21771.

The stable java/unvalidated-url-redirection query currently misses redirects created through Spring MVC view names and RedirectView.

This adds sink coverage for:

  • Values appended to a redirect: view name and returned from a Spring MVC request handler
  • Redirect view names constructed in helper methods
  • RedirectView constructors, including overloaded constructors
  • Calls to RedirectView.setUrl

The view-name modeling excludes @ResponseBody and @RestController methods. It also requires the constructed value to contribute to the returned view, so discarded redirect strings are not reported.

Validation:

  • Stable CWE-601 query tests
  • Experimental Spring CWE-601 query tests
  • QL formatting

@theinfosecguy
theinfosecguy marked this pull request as ready for review August 17, 2026 10:28
@theinfosecguy
theinfosecguy requested a review from a team as a code owner August 17, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False negative in java/unvalidated-url-redirection for Spring MVC redirect view names

1 participant