Rule Definition
A common development practice is to add "back door" code specifically designed for debugging or testing purposes that is not intended to be shipped or deployed with the application. These back door entry points create security risks because they are not considered during design or testing and fall outside of the expected operating conditions of the application.
Remediation
Disable Debug Spring Security's Debug mode using '@EnableWebSecurity(debug = false)'
Violation Code Sample
@Configuration
@EnableWebSecurity(debug = true) // Violation
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
...
}
Fixed Code Sample
@Configuration
@EnableWebSecurity(debug = false) // Violation Fixed
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
...
}
Reference
http://cwe.mitre.org/data/definitions/489.html
https://www.owasp.org/index.php/Top_10_2013-A6-Sensitive_Data_Exposure
Related Technologies
Technical Criterion
CWE-489 - Active Debug Code
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.