CVE-2022-31690: Spring Framework Spring-security-oauth2-client Vulnerable To Privilege Escalation Vulnerability

HIGH
Advisory Identifier: GHSA-32vj-v39g-jh23
CVSS 8.1
CWE-269
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2022-31690
GHSA Identifier GHSA-32vj-v39g-jh23
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-269: Improper Privilege Management
Affected Product Spring Framework
Package Ecosystem Maven
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

org.springframework.security:spring-security-oauth2-client fixed: 5.7.5
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-oauth2-client</artifactId>
    <version>5.7.5</version>
</dependency>
org.springframework.security:spring-security-oauth2-client fixed: 5.6.9
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-oauth2-client</artifactId>
    <version>5.6.9</version>
</dependency>
Verify Direct and Transitive Dependencies

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

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.

CVE-2022-31690 Affected Spring Framework Versions

2 component(s)
Fixed Versions:
5.7.55.6.9
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?
CVE-2022-31690 is a security vulnerability in Spring Framework involving spring-security-oauth2-client vulnerable to Privilege Escalation under CWE-269: Improper Privilege Management.
Which Spring Framework versions are affected?
Affected versions include releases prior to 5.7.5, 5.6.9 across affected packages: org.springframework.security:spring-security-oauth2-client.
What version fixes CVE-2022-31690?
Upgrading to 5.7.5, 5.6.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-security-oauth2-client affected?
Yes, org.springframework.security:spring-security-oauth2-client is affected in releases prior to 5.7.5, 5.6.9. Upgrade your dependency to 5.7.5, 5.6.9 or later.
What is the CVSS score of CVE-2022-31690?
CVE-2022-31690 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-31690?
CVE-2022-31690 is classified under CWE-269: Improper Privilege Management (The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.).
How can I check Maven dependencies for CVE-2022-31690?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.springframework.security'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}