Spring Security 7.1
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.165 lines · 2.4K tokens
Total370 lines · 12K tokens
CWE Coverage
- 15
- 20
- 22
- 59
- 73
- 78
- 79
- 88
- 89
- 90
- 95
- 113
- 117
- 190
- 201
- 203
- 208
- 209
- 214
- 250
- 295
- 297
- 306
- 307
- 308
- 319
- 323
- 327
- 329
- 338
- 345
- 346
- 347
- 352
- 362
- 367
- 378
- 384
- 409
- 427
- 470
- 471
- 488
- 494
- 502
- 524
- 532
- 552
- 601
- 611
- 613
- 639
- 640
- 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.1.1.
Filter-chain coverage
- Define ordered
SecurityFilterChainbeans with explicitsecurityMatchers; only the first matching chain runs, and a request matching no chain receives no Spring Security protection. - End with a catch-all chain and
anyRequest().authenticated()or an explicit denial;requestMatchersauthorize inside a chain but do not expand itssecurityMatcher. - Prefer
permitAlltoWebSecurityCustomizer.ignoring; ignored requests skip the filter chain, security context, and security headers, though theHttpFirewallstill validates them. - Keep the default
StrictHttpFirewall; treatsetAllowSemicolon, encoded-separator allowances, permissive header or parameter predicates, and especiallysetUnsafeAllowAnyHttpMethod(true)as parser and policy bypasses requiring container-to-router differential tests. - Cover request, async, error, and forward dispatches explicitly and test framework error pages and forwards against the intended chain.
- Remember that defining any custom chain replaces Spring Boot's default web security; reproduce every required login, logout, header, CSRF, and Actuator rule.
Method and object authorization
- Enable
@EnableMethodSecurity; pre/post annotations are enabled by default, whilesecuredEnabledandjsr250Enabledremain false unless selected. - Deny or annotate every service entry point intentionally because unannotated methods are allowed and proxy-based interception can be bypassed by self-invocation.
- Authorize tenant,