CVE-2023-34035: Spring Framework Spring Security's Authorization Rules Can Vulnerability
HIGHCVE-2023-34035 is a HIGH (CVSS 7.3) spring security's authorization rules can vulnerability (CWE-863: Incorrect Authorization) affecting Spring Framework libraries in the Maven ecosystem. The issue involves spring security's authorization rules can be misconfigured when using multiple servlets. Remediation is available by upgrading affected packages to version 5.8.5, 6.0.5, 6.1.2.
CVE-2023-34035 at a Glance
Security Impact
CVSS: 7.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2023-34035
To remediate this vulnerability, upgrade all affected Spring Framework dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>5.8.5</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>6.0.5</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>6.1.2</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.springframework.security
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2023-34035, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.springframework.security
Analyze the terminal output to locate any version of Spring Framework in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.8.5), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.springframework.security command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Spring Framework, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-34035 Affected Spring Framework Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.springframework.security:spring-security-config
|
Maven |
≥ 5.8.0
< 5.8.5
|
5.8.5
|
|
org.springframework.security:spring-security-config
|
Maven |
≥ 6.0.0
< 6.0.5
|
6.0.5
|
|
org.springframework.security:spring-security-config
|
Maven |
≥ 6.1.0
< 6.1.2
|
6.1.2
|
References
Frequently Asked Questions
What is CVE-2023-34035?
Which Spring Framework versions are affected?
What version fixes CVE-2023-34035?
Is spring-security-config affected?
What is the CVSS score of CVE-2023-34035?
What CWE is associated with CVE-2023-34035?
How can I check Maven dependencies for CVE-2023-34035?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4vpr-xfrp-cj64",
"modified" : "2023-07-27T16:16:27Z",
"published" : "2023-07-18T18:30:36Z",
"aliases" : [ "CVE-2023-34035" ],
"summary" : "Spring Security's authorization rules can be misconfigured when using multiple servlets",
"details" : "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.)\n\nSpecifically, an application is vulnerable when all of the following are true:\n\n * Spring MVC is on the classpath\n * Spring Security is securing more than one servlet in a single application (one of them being Spring MVC’s DispatcherServlet)\n * The application uses requestMatchers(String) to refer to endpoints that are not Spring MVC endpoints\n\n\nAn application is not vulnerable if any of the following is true:\n\n * The application does not have Spring MVC on the classpath\n * The application secures no servlets other than Spring MVC’s DispatcherServlet\n * The application uses requestMatchers(String) only for Spring MVC endpoints",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.security:spring-security-config"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.8.0"
}, {
"fixed" : "5.8.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.security:spring-security-config"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "6.0.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.security:spring-security-config"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.1.0"
}, {
"fixed" : "6.1.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34035"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-security-samples/commit/4e3bec904a5467db28ea33e25ac9d90524b53d66"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-security/commit/bb46a5427005e33e637b15948de8adae244ce547"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-security/commit/df239b6448ccf138b0c95b5575a88f33ac35cd9a"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-security-samples/tree/main/servlet/java-configuration/authentication/preauth"
}, {
"type" : "WEB",
"url" : "https://spring.io/security/cve-2023-34035"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-863" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-07-19T22:10:34Z",
"nvd_published_at" : "2023-07-18T16:15:11Z"
}
}