Cloudanix VulnDB

CVE-2016-5007

High · 7.5

CVSS

7.5

EPSS

2.8%

Published

May 25, 2017

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

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

  1. Map application endpoints and authorization rules
  2. Craft URLs exploiting pattern-matching differences such as whitespace trimming
  3. Submit requests that bypass Spring Security filters but reach protected controllers
  4. 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