CVE-2016-5007
High · 7.5CVSS
7.5
EPSS
2.8%
Published
May 25, 2017
CISA due date
—
Cloudanix analysis
A web application may let visitors reach pages or features they are not supposed to see because two security components disagree on how web addresses are checked.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Privilege Gain
- Component
- Web Framework
- Class
- Authorization Bypass
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Differences in URL pattern matching strictness between Spring Security and Spring Framework allow paths that should be protected to bypass authorization checks while still being routed to controllers.
Why it matters to the business
Attackers can reach protected application functionality without authentication or authorization, increasing risk of data exposure or unauthorized operations.
How an attack unfolds
An attacker identifies a protected controller endpoint, crafts a request URL containing whitespace or other pattern variations that Spring Security treats differently than Spring MVC, and gains access to the resource that should have been blocked.
How to fix it
Upgrade Spring Security to 3.2.10+, 4.0.4+, 4.1.1+ and Spring Framework to 3.2.14+, 4.0.9+, 4.1.7+, 4.2.1+ or later; align custom pattern matchers across both components; test authorization coverage after upgrade.
How to confirm the fix worked
Review application logs and configuration for URL pattern definitions, test previously bypassable paths after patching, and verify that protected controllers now correctly require authentication.
Typical attack path
- Map application endpoints and authorization rules
- Craft URLs exploiting pattern-matching differences such as whitespace trimming
- Submit requests that bypass Spring Security filters but reach protected controllers
- Perform unauthorized actions on the application
How to detect it
Search web server and application logs for requests to protected paths that lack corresponding authentication or authorization events; look for patterns containing unusual whitespace or encoding.
What your security team should do
- Apply the listed Spring Security and Framework upgrades immediately
- Audit all URL pattern mappings for consistency between security and MVC layers
- Add regression tests covering edge-case URL patterns
- Monitor for unusual access to previously protected endpoints
The record
Both Spring Security 3.2.x, 4.0.x, 4.1.0 and the Spring Framework 3.2.x, 4.0.x, 4.1.x, 4.2.x rely on URL pattern mappings for authorization and for mapping requests to controllers respectively. Differences in the strictness of the pattern matching mechanisms, for example with regards to space trimming in path segments, can lead Spring Security to not recognize certain paths as not protected that are in fact mapped to Spring MVC controllers that should be protected. The problem is compounded by the fact that the Spring Framework provides richer features with regards to pattern matching as well as by the fact that pattern matching in each Spring Security and the Spring Framework can easily be customized creating additional differences.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Maven | org.springframework.security:spring-security-core | 0 | 4.1.1 |
| Maven | org.springframework:spring-core | 0 | 4.3.1 |
| Debian:11 | libspring-java | 0 | 4.3.2-1 |
| Debian:12 | libspring-java | 0 | 4.3.2-1 |
| Debian:13 | libspring-java | 0 | 4.3.2-1 |
| Ubuntu:Pro:14.04:LTS | libspring-java | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | libspring-java | 0 | No fix |
Related vulnerabilities
- GHSA-vqxh-445g-37fc Spring Security has a broken timing attack mitigation implemented in… Also affects org.springframework.security:spring-security-core
- CVE-2025-22234 The fix applied in CVE-2025-22228 inadvertently broke the timing attack mitigation… Also affects org.springframework.security:spring-security-core
- CVE-2025-41248 The Spring Security annotation detection mechanism may not correctly resolve annotations… Also affects org.springframework.security:spring-security-core
- CVE-2025-41232 Spring Security Aspects may not correctly locate method security annotations on private… Also affects org.springframework.security:spring-security-core
- CVE-2025-22223 Spring Security 6.4.0 - 6.4.3 may not correctly locate method security annotations on… Also affects org.springframework.security:spring-security-core
- CVE-2024-38827 The usage of String.toLowerCase() and String.toUpperCase() has some Locale dependent… Also affects org.springframework.security:spring-security-core
- CVE-2024-38810 Missing Authorization When Using @AuthorizeReturnObject in Spring Security 6.3.0 and… Also affects org.springframework.security:spring-security-core
- CVE-2024-22257 In Spring Security, versions 5.7.x prior to 5.7.12, 5.8.x prior to 5.8.11, versions 6.0.x… Also affects org.springframework.security:spring-security-core