CVE-2020-26938: Oauth2 server Oauth2-server Through 3.1.1 Vulnerable To Vulnerability
HIGHCVE-2020-26938 is a HIGH (CVSS 7.2) oauth2-server through 3.1.1 vulnerable to vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Oauth2 server libraries in the npm ecosystem. The issue involves oauth2-server through 3.1.1 vulnerable to open redirect. Remediation is available in the latest vendor maintenance releases.
CVE-2020-26938 at a Glance
Security Impact
CVSS: 7.2
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:C/C:L/I:L/A:N).
How to Fix CVE-2020-26938
To remediate this vulnerability, upgrade all affected Oauth2 server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install oauth2-server@Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls oauth2-server
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-26938, inspect your project dependencies using npm:
npm ls oauth2-server
Analyze the terminal output to locate any version of Oauth2 server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The npm ls oauth2-server command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
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 Oauth2 server, 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-2020-26938 Affected Oauth2 server Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
oauth2-server
|
npm |
≤ 3.1.1
|
|
References
Frequently Asked Questions
What is CVE-2020-26938?
Which Oauth2 server versions are affected?
What version fixes CVE-2020-26938?
Is oauth2-server affected?
What is the CVSS score of CVE-2020-26938?
What CWE is associated with CVE-2020-26938?
How can I check npm dependencies for CVE-2020-26938?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4rg6-fm25-gc34",
"modified" : "2022-09-16T19:36:13Z",
"published" : "2022-08-30T00:00:26Z",
"aliases" : [ "CVE-2020-26938" ],
"summary" : "oauth2-server through 3.1.1 vulnerable to Open Redirect",
"details" : "In oauth2-server (aka node-oauth2-server) through 3.1.1, the value of the `redirect_uri` parameter received during the authorization and token request is checked against an incorrect URI pattern (`[a-zA-Z][a-zA-Z0-9+.-]+:`) before making a redirection. This allows a malicious client to pass an XSS payload through the redirect_uri parameter while making an authorization request. NOTE: this vulnerability is similar to CVE-2020-7741.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "oauth2-server"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "3.1.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-26938"
}, {
"type" : "WEB",
"url" : "https://github.com/oauthjs/node-oauth2-server/issues/637"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/oauthjs/node-oauth2-server"
}, {
"type" : "WEB",
"url" : "https://github.com/oauthjs/node-oauth2-server/blob/91d2cbe70a0eddc53d72def96864e2de0fd41703/lib/grant-types/authorization-code-grant-type.js#L143"
}, {
"type" : "WEB",
"url" : "https://github.com/oauthjs/node-oauth2-server/blob/91d2cbe70a0eddc53d72def96864e2de0fd41703/lib/validator/is.js#L12"
}, {
"type" : "WEB",
"url" : "https://tools.ietf.org/html/rfc3986#section-3"
}, {
"type" : "WEB",
"url" : "https://tools.ietf.org/html/rfc6749#section-3.1.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-601" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-09-16T19:36:13Z",
"nvd_published_at" : "2022-08-29T21:15:00Z"
}
}