Spring Security 7.0

Last reviewed Oct 11, 2026

Export as PDF

Prompt Details

Prompt Composition

5prompts
  1. Java 25113 lines · 2.8K tokens
  2. Spring Framework 7.070 lines · 2.4K tokens
  3. Spring Boot 4.162 lines · 2.7K tokens
  4. Spring MVC 7.060 lines · 1.8K tokens
  5. 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 SecurityFilterChain bean an explicit securityMatcher and 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() or anyRequest().authenticated(), so a route added later isn't unprotected by omission.
  • Replace the MvcRequestMatcher and AntPathRequestMatcher usages 7.0 removed with PathPatternRequestMatcher, and re-test every pattern, since the replacement parses paths differently.
  • Finish migrating authorizeRequests to authorizeHttpRequests and the removed and() 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 permitAll to WebSecurityCustomizer.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 treat setAllowSemicolon, encoded-slash allowances, permissive header or parameter predicates, and setUnsafeAllowAnyHttpMethod(true) as parser bypasses needing differential testing against the servlet container.
  • Any SecurityFilterChain bean replaces Spring