SKY-D433 · Security in code
Spring Security CSRF disabled
Skylos reports Java Spring Security configurations that explicitly disable cross-site request forgery protection. The finding points to the Java call that configures CSRF.
- Languages
- Java
- Quality gate
- counted toward the gate limits (full and diff scans)
- Finding type
- review
Why it matters
When a browser attaches credentials automatically, an application needs a separate way to verify that a state-changing request was intentional.
What Skylos flags
import org.springframework.security.config.annotation.web.builders.HttpSecurity; class SecurityConfig { void configure(HttpSecurity http) { http.csrf(csrf -> csrf.disable()); }}What Skylos leaves alone
import org.springframework.security.config.Customizer;import org.springframework.security.config.annotation.web.builders.HttpSecurity; class SecurityConfig { void configure(HttpSecurity http) { http.csrf(Customizer.withDefaults()); }}Why Skylos leaves it alone
The configuration keeps Spring Security's default CSRF protection enabled.
How Skylos decides
- Requires a resolved Spring Security HttpSecurity receiver.
- Recognizes legacy csrf().disable() and supported callbacks that call disable on the CSRF configurer.
- Reports a review finding. The scanner does not establish how the chain authenticates requests at runtime.
How to fix it
Keep CSRF protection for browser-authenticated routes. If a chain uses only credentials that browsers do not attach automatically, review that chain explicitly.
When it can be wrong
- An isolated API chain may intentionally use only explicit authorization headers. Check the chain matching and credential types before accepting the finding.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Mark the reviewed line with a rule-scoped Skylos ignore for SKY-D433. Record the evidence that justifies the exception.