CVE-2023-34035 Spring Security's authorization rules can be misconfigured when using multiple servlets

High 7.3 Published Updated

Attackers can bypass authorization rules in Spring Security applications using multiple servlets and specific request matcher configurations.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-34035?

CVE-2023-34035 is a high-severity missing authorization vulnerability in Spring Security, published on 18 Jul 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Spring Security versions 5.8 prior to 5.8.5, 6.0 prior to 6.0.5, and 6.1 prior to 6.1.2 could be susceptible to authorization rule misconfiguration if the application uses requestMatchers(String) and multiple servlets, one of them being Spring MVC’s DispatcherServlet. (DispatcherServlet is a Spring MVC component that maps HTTP endpoints to methods on @Controller-annotated classes.)

Specifically, an application is vulnerable when all of the following are true:

* Spring MVC is on the classpath * Spring Security is securing more than one servlet in a single application (one of them being Spring MVC’s DispatcherServlet) * The application uses requestMatchers(String) to refer to endpoints that are not Spring MVC endpoints

An application is not vulnerable if any of the following is true:

* The application does not have Spring MVC on the classpath * The application secures no servlets other than Spring MVC’s DispatcherServlet * The application uses requestMatchers(String) only for Spring MVC endpoints

Weakness: CWE-863

Which versions are affected by CVE-2023-34035?

6 open source packages ship an affected version, including org.springframework.security:spring-security-config. It affects 1 product.

PackageAffectedFixed in
org.springframework.security:spring-security-config MavenFrom 5.8.05.8.5
org.springframework.security:spring-security-config MavenFrom 5.8.05.8.5
org.springframework.security:spring-security-config MavenFrom 6.0.06.0.5
org.springframework.security:spring-security-config MavenFrom 6.0.06.0.5
org.springframework.security:spring-security-config MavenFrom 6.1.06.1.2
org.springframework.security:spring-security-config MavenFrom 6.1.06.1.2

Products include Vmware Spring Security.

How do I fix CVE-2023-34035?

Upgrade org.springframework.security:spring-security-config to a fixed version for your release line: 5.8.5, 6.0.5 or 6.1.2.

Upgrade, and check permissions on every request on the server, not only in the interface. More about Missing authorization.

Is CVE-2023-34035 being exploited?

There is no known exploitation of CVE-2023-34035 in the wild and no public exploit code.

Public exploit code: 2 proofs of concept on GitHub.

Sources

Also known as GHSA-4vpr-xfrp-cj64.

Is CVE-2023-34035 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free