CVE-2019-3778: Spring Framework Spring-security-oauth And Spring-security-oauth2 Open Redirect Vulnerability

MODERATE
Advisory Identifier: GHSA-77rv-6vfw-x4gc
CVSS 6.5
CWE-601
Published
Advisory Summary

CVE-2019-3778 is a MODERATE (CVSS 6.5) spring-security-oauth and spring-security-oauth2 open redirect vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Spring Framework libraries in the Maven ecosystem. The issue involves spring-security-oauth and spring-security-oauth2 open redirect vulnerability. Remediation is available by upgrading affected packages to version 2.0.17.RELEASE, 2.1.4.RELEASE, 2.2.4.RELEASE, 2.3.5.RELEASE.

CVE-2019-3778 at a Glance

CVE Identifier CVE-2019-3778
GHSA Identifier GHSA-77rv-6vfw-x4gc
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Spring Framework
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2019-3778

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-oauth fixed: 2.0.17.RELEASE
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth</artifactId>
    <version>2.0.17.RELEASE</version>
</dependency>
org.springframework.security.oauth:spring-security-oauth2 fixed: 2.0.17.RELEASE
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth2</artifactId>
    <version>2.0.17.RELEASE</version>
</dependency>
org.springframework.security.oauth:spring-security-oauth fixed: 2.1.4.RELEASE
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth</artifactId>
    <version>2.1.4.RELEASE</version>
</dependency>
org.springframework.security.oauth:spring-security-oauth2 fixed: 2.1.4.RELEASE
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth2</artifactId>
    <version>2.1.4.RELEASE</version>
</dependency>
org.springframework.security.oauth:spring-security-oauth fixed: 2.2.4.RELEASE
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth</artifactId>
    <version>2.2.4.RELEASE</version>
</dependency>
org.springframework.security.oauth:spring-security-oauth2 fixed: 2.2.4.RELEASE
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth2</artifactId>
    <version>2.2.4.RELEASE</version>
</dependency>
org.springframework.security.oauth:spring-security-oauth fixed: 2.3.5.RELEASE
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth</artifactId>
    <version>2.3.5.RELEASE</version>
</dependency>
org.springframework.security.oauth:spring-security-oauth2 fixed: 2.3.5.RELEASE
<dependency>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth2</artifactId>
    <version>2.3.5.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-2019-3778, 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.17.RELEASE), 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-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. 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.5, and 2.2 prior to 2.2.4, and 2.1 prior to 2.1.4, and 2.0 prior to 2.0.17, and older unsupported versions could be susceptible to an open redirector attack that can leak an authorization code. A malicious user or attacker can craft a request to the authorization endpoint using the authorization code grant type, and specify a manipulated redirection URI via the "redirect_uri" parameter. This can cause the authorization server to redirect the resource owner user-agent to a URI under the control of the attacker with the leaked authorization code. This vulnerability exposes applications that meet all of the following requirements: Act in the role of an Authorization Server (e.g. @EnableAuthorizationServer) and uses the DefaultRedirectResolver in the AuthorizationEndpoint. This vulnerability does not expose applications that: Act in the role of an Authorization Server and uses a different RedirectResolver implementation other than DefaultRedirectResolver, act in the role of a Resource Server only (e.g. @EnableResourceServer), act in the role of a Client only (e.g. @EnableOAuthClient).

CVE-2019-3778 Affected Spring Framework Versions

8 component(s)
Fixed Versions:
2.0.17.RELEASE2.1.4.RELEASE2.2.4.RELEASE2.3.5.RELEASE
Product / Package Ecosystem Affected Versions Fixed Version
org.springframework.security.oauth:spring-security-oauth
Maven
< 2.0.17.RELEASE
2.0.17.RELEASE
org.springframework.security.oauth:spring-security-oauth2
Maven
< 2.0.17.RELEASE
2.0.17.RELEASE
org.springframework.security.oauth:spring-security-oauth
Maven
≥ 2.1.0.RELEASE
< 2.1.4.RELEASE
2.1.4.RELEASE
org.springframework.security.oauth:spring-security-oauth2
Maven
≥ 2.1.0.RELEASE
< 2.1.4.RELEASE
2.1.4.RELEASE
org.springframework.security.oauth:spring-security-oauth
Maven
≥ 2.2.0.RELEASE
< 2.2.4.RELEASE
2.2.4.RELEASE
org.springframework.security.oauth:spring-security-oauth2
Maven
≥ 2.2.0.RELEASE
< 2.2.4.RELEASE
2.2.4.RELEASE
org.springframework.security.oauth:spring-security-oauth
Maven
≥ 2.3.0.RELEASE
< 2.3.5.RELEASE
2.3.5.RELEASE
org.springframework.security.oauth:spring-security-oauth2
Maven
≥ 2.3.0.RELEASE
< 2.3.5.RELEASE
2.3.5.RELEASE

References

Frequently Asked Questions

What is CVE-2019-3778?
CVE-2019-3778 is a security vulnerability in Spring Framework involving spring-security-oauth and spring-security-oauth2 Open Redirect vulnerability under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Spring Framework versions are affected?
Affected versions include releases prior to 2.0.17.RELEASE, 2.1.4.RELEASE, 2.2.4.RELEASE, 2.3.5.RELEASE across affected packages: org.springframework.security.oauth:spring-security-oauth, org.springframework.security.oauth:spring-security-oauth2.
What version fixes CVE-2019-3778?
Upgrading to 2.0.17.RELEASE, 2.1.4.RELEASE, 2.2.4.RELEASE, 2.3.5.RELEASE (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-security-oauth affected?
Yes, org.springframework.security.oauth:spring-security-oauth is affected in releases prior to 2.0.17.RELEASE, 2.1.4.RELEASE, 2.2.4.RELEASE, 2.3.5.RELEASE. Upgrade your dependency to 2.0.17.RELEASE, 2.1.4.RELEASE, 2.2.4.RELEASE, 2.3.5.RELEASE or later.
Is spring-security-oauth2 affected?
Yes, org.springframework.security.oauth:spring-security-oauth2 is affected in releases prior to 2.0.17.RELEASE, 2.1.4.RELEASE, 2.2.4.RELEASE, 2.3.5.RELEASE. Upgrade your dependency to 2.0.17.RELEASE, 2.1.4.RELEASE, 2.2.4.RELEASE, 2.3.5.RELEASE or later.
What is the CVSS score of CVE-2019-3778?
CVE-2019-3778 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2019-3778?
CVE-2019-3778 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Maven dependencies for CVE-2019-3778?
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-77rv-6vfw-x4gc",
  "modified" : "2023-06-20T18:31:23Z",
  "published" : "2019-03-14T15:39:30Z",
  "aliases" : [ "CVE-2019-3778" ],
  "summary" : "spring-security-oauth and spring-security-oauth2 Open Redirect vulnerability",
  "details" : "Spring Security OAuth, versions 2.3 prior to 2.3.5, and 2.2 prior to 2.2.4, and 2.1 prior to 2.1.4, and 2.0 prior to 2.0.17, and older unsupported versions could be susceptible to an open redirector attack that can leak an authorization code.\n\nA malicious user or attacker can craft a request to the authorization endpoint using the authorization code grant type, and specify a manipulated redirection URI via the \"redirect_uri\" parameter. This can cause the authorization server to redirect the resource owner user-agent to a URI under the control of the attacker with the leaked authorization code.\n\nThis vulnerability exposes applications that meet all of the following requirements: Act in the role of an Authorization Server (e.g. @EnableAuthorizationServer) and uses the DefaultRedirectResolver in the AuthorizationEndpoint. \n\nThis vulnerability does not expose applications that: Act in the role of an Authorization Server and uses a different RedirectResolver implementation other than DefaultRedirectResolver, 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.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security.oauth:spring-security-oauth"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.17.RELEASE"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security.oauth:spring-security-oauth2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.17.RELEASE"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security.oauth:spring-security-oauth"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0.RELEASE"
      }, {
        "fixed" : "2.1.4.RELEASE"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security.oauth:spring-security-oauth2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0.RELEASE"
      }, {
        "fixed" : "2.1.4.RELEASE"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security.oauth:spring-security-oauth"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0.RELEASE"
      }, {
        "fixed" : "2.2.4.RELEASE"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security.oauth:spring-security-oauth2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0.RELEASE"
      }, {
        "fixed" : "2.2.4.RELEASE"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security.oauth:spring-security-oauth"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0.RELEASE"
      }, {
        "fixed" : "2.3.5.RELEASE"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security.oauth:spring-security-oauth2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0.RELEASE"
      }, {
        "fixed" : "2.3.5.RELEASE"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-3778"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spring-attic/spring-security-oauth"
  }, {
    "type" : "WEB",
    "url" : "https://pivotal.io/security/cve-2019-3778"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200227084837/http://www.securityfocus.com/bid/107153"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujan2021.html"
  }, {
    "type" : "WEB",
    "url" : "http://packetstormsecurity.com/files/153299/Spring-Security-OAuth-2.3-Open-Redirection.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:22:03Z",
    "nvd_published_at" : "2019-03-07T18:29:00Z"
  }
}