Spring WebFlux – CVE-2023-34034 – Write-Up and Proof-of-Concept
A broken access control vulnerability in Spring Security for WebFlux applications caused path matchers without a leading slash to fail to match, allowing unauthenticated access to protected endpoints. An attacker could access admin pages without authentication if the application used such a misconfigured matcher.
Published on jfrog.com
Spring Security’s newly released versions contain a fix for a broken access control vulnerability – CVE-2023-34034 – which was given a critical NVD severity (CVSS 9.8) and a high severity by Spring’s maintainers.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The path matcher did not prepend a leading slash to patterns that lacked one, so patterns like 'admin/**' failed to match actual request paths that start with '/admin/'.
Impact
An attacker could access privileged endpoints without authentication if the application used a vulnerable path matcher without a leading slash, potentially leading to full admin access.
What the attacker needed
Spring WebFlux application; Vulnerable Spring Security version; URL path filter without leading slash
The fix
The vulnerability was fixed in Spring Security versions 6.1.2+, 6.0.5+, 5.8.5+, 5.7.10+, and 5.6.12+; alternatively, add a leading forward slash to any URL filter used in Spring Security.
How it was found
- Set up a Spring WebFlux application with Spring Security and a vulnerable version.
- Configure access rules using a path pattern without a leading slash, such as 'admin/**'.
- Send a request to a protected endpoint like '/admin/supershell' without authentication.
- Observe that the request is granted access because the rule does not match.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Spring Security is a tool that helps Java applications decide who can access which pages. A mistake in how it checked URL patterns meant that rules meant to protect admin pages didn't work if the pattern didn't start with a slash. This let anyone visit those admin pages without logging in.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.