JAVA-021 / Intermediate
Overly permissive Spring Security path rules (permitAll abuse)
Why is this a problem?
Rules following /** are ignored; wildcard ordering mistakes can expose admin APIs.
How to fix it
java
http.authorizeHttpRequests(a -> a
.requestMatchers("/api/public/**").permitAll()
.requestMatchers("/api/admin/**").hasRole("ADMIN")
.anyRequest().authenticated());