CVE-2022-31690: Spring Framework Spring-security-oauth2-client Vulnerable To Privilege Escalation Vulnerability
HIGHCVE-2022-31690 is a HIGH (CVSS 8.1) spring-security-oauth2-client vulnerable to privilege escalation vulnerability (CWE-269: Improper Privilege Management) affecting Spring Framework libraries in the Maven ecosystem. The issue involves spring-security-oauth2-client vulnerable to privilege escalation. Remediation is available by upgrading affected packages to version 5.7.5, 5.6.9.
CVE-2022-31690 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-31690
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-oauth2-client</artifactId>
<version>5.7.5</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-client</artifactId>
<version>5.6.9</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-2022-31690, 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.7.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-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. 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-2022-31690 Affected Spring Framework Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.springframework.security:spring-security-oauth2-client
|
Maven |
≥ 5.7.0
< 5.7.5
|
5.7.5
|
|
org.springframework.security:spring-security-oauth2-client
|
Maven |
< 5.6.9
|
5.6.9
|
References
Frequently Asked Questions
What is CVE-2022-31690?
Which Spring Framework versions are affected?
What version fixes CVE-2022-31690?
Is spring-security-oauth2-client affected?
What is the CVSS score of CVE-2022-31690?
What CWE is associated with CVE-2022-31690?
How can I check Maven dependencies for CVE-2022-31690?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-32vj-v39g-jh23",
"modified" : "2022-11-02T21:50:11Z",
"published" : "2022-11-01T12:00:37Z",
"aliases" : [ "CVE-2022-31690" ],
"summary" : "spring-security-oauth2-client vulnerable to Privilege Escalation",
"details" : "Spring Security, versions 5.7 prior to 5.7.5, and 5.6 prior to 5.6.9, and older unsupported versions could be susceptible to a privilege escalation under certain conditions. A malicious user or attacker can modify a request initiated by the Client (via the browser) to the Authorization Server which can lead to a privilege escalation on the subsequent approval. This scenario can happen if the Authorization Server responds with an OAuth2 Access Token Response containing an empty scope list (per RFC 6749, Section 5.1) on the subsequent request to the token endpoint to obtain the access token.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.security:spring-security-oauth2-client"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.7.0"
}, {
"fixed" : "5.7.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.security:spring-security-oauth2-client"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.6.9"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31690"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-security-samples/blob/4638e1e428ee2ddab234199eb3b67b9c94dfa08b/servlet/spring-boot/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java#L48"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20221215-0010"
}, {
"type" : "WEB",
"url" : "https://tanzu.vmware.com/security/cve-2022-31690"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-269" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-11-01T17:27:45Z",
"nvd_published_at" : "2022-10-31T20:15:00Z"
}
}