Spring Security 7.0
Last reviewed Oct 11, 2026
Prompt Details
Prompt Composition
5prompts
- Java 25113 lines · 2.8K tokens
- Spring Framework 7.070 lines · 2.4K tokens
- Spring Boot 4.162 lines · 2.7K tokens
- Spring MVC 7.060 lines · 1.8K tokens
- Spring Security 7.075 lines · 2.4K tokens
Total380 lines · 12.1K tokens
CWE Coverage
- 15
- 20
- 22
- 59
- 73
- 78
- 79
- 88
- 89
- 95
- 113
- 117
- 190
- 201
- 203
- 208
- 209
- 214
- 250
- 295
- 297
- 306
- 307
- 308
- 319
- 323
- 327
- 338
- 346
- 347
- 352
- 362
- 367
- 378
- 384
- 409
- 427
- 470
- 471
- 494
- 502
- 524
- 532
- 552
- 601
- 611
- 613
- 639
- 653
- 681
- 732
- 749
- 770
- 772
- 776
- 789
- 807
- 829
- 862
- 863
- 913
- 915
- 916
- 918
- 922
- 942
- 1333
Prompt Preview
Apply the Spring MVC 7.0 baseline first. These rules cover Spring Security 7.0.7.
Filter chains and request matching
- Give every
SecurityFilterChainbean an explicitsecurityMatcherand a deliberate order: only the first chain whose matcher accepts a request runs, and a request matching no chain gets no Spring Security authentication or authorization. - End the chain list with a catch-all chain closing with
anyRequest().denyAll()oranyRequest().authenticated(), so a route added later isn't unprotected by omission. - Replace the
MvcRequestMatcherandAntPathRequestMatcherusages 7.0 removed withPathPatternRequestMatcher, and re-test every pattern, since the replacement parses paths differently. - Finish migrating
authorizeRequeststoauthorizeHttpRequestsand the removedand()chaining to the lambda DSL; the removed APIs don't compile against 7.0. - Authorize the FORWARD, ERROR, and INCLUDE dispatcher types deliberately with
dispatcherTypeMatchers, and register the security filter for those dispatches so error pages are neither denied nor wide open. - Prefer
permitAlltoWebSecurityCustomizer.ignoring; an ignored request skips the filter chain, the security context, and every Spring Security response header the application relies on. - Keep the default
StrictHttpFirewall, and treatsetAllowSemicolon, encoded-slash allowances, permissive header or parameter predicates, andsetUnsafeAllowAnyHttpMethod(true)as parser bypasses needing differential testing against the servlet container. - Any
SecurityFilterChainbean replaces Spring