CVE-2018-15758: Spring Framework Spring-security-oauth2 Vulnerability

HIGH
Advisory Identifier: GHSA-h8w4-qv99-f7vj
CVSS 8.1
CWE-269
Published
Advisory Summary

CVE-2018-15758 is a HIGH (CVSS 8.1) spring-security-oauth2 vulnerability (CWE-269: Improper Privilege Management) affecting Spring Framework libraries in the Maven ecosystem. The issue involves spring-security-oauth2. Remediation is available by upgrading affected packages to version 2.0.16, 2.1.3, 2.2.3.RELEASE, 2.3.4.RELEASE.

CVE-2018-15758 at a Glance

CVE Identifier CVE-2018-15758
GHSA Identifier GHSA-h8w4-qv99-f7vj
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.0/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-2018-15758

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.oauth:spring-security-oauth2 fixed: 2.0.16
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth2</artifactId>
    <version>2.0.16</version>
</dependency>
org.springframework.security.oauth:spring-security-oauth2 fixed: 2.1.3
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth2</artifactId>
    <version>2.1.3</version>
</dependency>
org.springframework.security.oauth:spring-security-oauth2 fixed: 2.2.3.RELEASE
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth2</artifactId>
    <version>2.2.3.RELEASE</version>
</dependency>
org.springframework.security.oauth:spring-security-oauth2 fixed: 2.3.4.RELEASE
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth2</artifactId>
    <version>2.3.4.RELEASE</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.oauth

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2018-15758, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.springframework.security.oauth

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 2.0.16), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.springframework.security.oauth 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 OAuth, versions 2.3 prior to 2.3.4, and 2.2 prior to 2.2.3, and 2.1 prior to 2.1.3, and 2.0 prior to 2.0.16, and older unsupported versions could be susceptible to a privilege escalation under certain conditions. A malicious user or attacker can craft a request to the approval endpoint that can modify the previously saved authorization request and lead to a privilege escalation on the subsequent approval. This scenario can happen if the application is configured to use a custom approval endpoint that declares AuthorizationRequest as a controller method argument. This vulnerability exposes applications that meet all of the following requirements: Act in the role of an Authorization Server (e.g. @EnableAuthorizationServer) and use a custom Approval Endpoint that declares AuthorizationRequest as a controller method argument. This vulnerability does not expose applications that: Act in the role of an Authorization Server and use the default Approval Endpoint, act in the role of a Resource Server only (e.g. @EnableResourceServer), act in the role of a Client only (e.g. @EnableOAuthClient).

CVE-2018-15758 Affected Spring Framework Versions

4 component(s)
Fixed Versions:
2.0.162.1.32.2.3.RELEASE2.3.4.RELEASE
Product / Package Ecosystem Affected Versions Fixed Version
org.springframework.security.oauth:spring-security-oauth2
Maven
≥ 2.0.0
< 2.0.16
2.0.16
org.springframework.security.oauth:spring-security-oauth2
Maven
≥ 2.1.0
< 2.1.3
2.1.3
org.springframework.security.oauth:spring-security-oauth2
Maven
≥ 2.2.0
< 2.2.3.RELEASE
2.2.3.RELEASE
org.springframework.security.oauth:spring-security-oauth2
Maven
≥ 2.3.0
< 2.3.4.RELEASE
2.3.4.RELEASE

References

Frequently Asked Questions

What is CVE-2018-15758?
CVE-2018-15758 is a security vulnerability in Spring Framework involving spring-security-oauth2 under CWE-269: Improper Privilege Management.
Which Spring Framework versions are affected?
Affected versions include releases prior to 2.0.16, 2.1.3, 2.2.3.RELEASE, 2.3.4.RELEASE across affected packages: org.springframework.security.oauth:spring-security-oauth2.
What version fixes CVE-2018-15758?
Upgrading to 2.0.16, 2.1.3, 2.2.3.RELEASE, 2.3.4.RELEASE (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-security-oauth2 affected?
Yes, org.springframework.security.oauth:spring-security-oauth2 is affected in releases prior to 2.0.16, 2.1.3, 2.2.3.RELEASE, 2.3.4.RELEASE. Upgrade your dependency to 2.0.16, 2.1.3, 2.2.3.RELEASE, 2.3.4.RELEASE or later.
What is the CVSS score of CVE-2018-15758?
CVE-2018-15758 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-15758?
CVE-2018-15758 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-2018-15758?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.springframework.security.oauth'. 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-h8w4-qv99-f7vj",
  "modified" : "2024-03-04T21:20:57Z",
  "published" : "2018-10-19T22:00:28Z",
  "aliases" : [ "CVE-2018-15758" ],
  "summary" : "Authorization bypass in org.springframework.security.oauth:spring-security-oauth2",
  "details" : "Spring Security OAuth, versions 2.3 prior to 2.3.4, and 2.2 prior to 2.2.3, and 2.1 prior to 2.1.3, and 2.0 prior to 2.0.16, and older unsupported versions could be susceptible to a privilege escalation under certain conditions. A malicious user or attacker can craft a request to the approval endpoint that can modify the previously saved authorization request and lead to a privilege escalation on the subsequent approval. This scenario can happen if the application is configured to use a custom approval endpoint that declares AuthorizationRequest as a controller method argument. This vulnerability exposes applications that meet all of the following requirements: Act in the role of an Authorization Server (e.g. @EnableAuthorizationServer) and use a custom Approval Endpoint that declares AuthorizationRequest as a controller method argument. This vulnerability does not expose applications that: Act in the role of an Authorization Server and use the default Approval Endpoint, act in the role of a Resource Server only (e.g. @EnableResourceServer), act in the role of a Client only (e.g. @EnableOAuthClient).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security.oauth:spring-security-oauth2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.16"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security.oauth:spring-security-oauth2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0"
      }, {
        "fixed" : "2.1.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security.oauth:spring-security-oauth2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0"
      }, {
        "fixed" : "2.2.3.RELEASE"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security.oauth:spring-security-oauth2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0"
      }, {
        "fixed" : "2.3.4.RELEASE"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-15758"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-attic/spring-security-oauth/commit/4082ec7ae3d39198a47b5c803ccb20dacefb0b0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-attic/spring-security-oauth/commit/623776689fdcc8047f5a908c71f348e1f172a97"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-attic/spring-security-oauth/commit/ddd65cd9417ae1e4a69e4193a622300db38e2ef"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-attic/spring-security-oauth/commit/f92223afc71687bd3156298054903f50aa71fbf"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2019:2413"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-h8w4-qv99-f7vj"
  }, {
    "type" : "WEB",
    "url" : "https://pivotal.io/security/cve-2018-15758"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/105687"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-269" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:39:36Z",
    "nvd_published_at" : null
  }
}