CVE-2017-18924: Oauth2 server Code Injection Vulnerability
HIGHCVE-2017-18924 is a HIGH (CVSS 7.5) code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Oauth2 server libraries in the npm ecosystem. The issue involves code injection in oauth2-server. Remediation is available in the latest vendor maintenance releases.
CVE-2017-18924 at a Glance
Security Impact
CVSS: 7.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:H/I:N/A:N).
How to Fix CVE-2017-18924
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-2017-18924, 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. 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-2017-18924 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-2017-18924?
Which Oauth2 server versions are affected?
What version fixes CVE-2017-18924?
Is oauth2-server affected?
What is the CVSS score of CVE-2017-18924?
What CWE is associated with CVE-2017-18924?
How can I check npm dependencies for CVE-2017-18924?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2fw4-mgq9-39cx",
"modified" : "2021-04-21T21:15:38Z",
"published" : "2021-04-22T15:53:45Z",
"aliases" : [ "CVE-2017-18924" ],
"summary" : "Code Injection in oauth2-server",
"details" : "\"oauth2-server (aka node-oauth2-server) through 3.1.1 implements OAuth 2.0 without PKCE. It does not prevent authorization code injection. This is similar to CVE-2020-7692. NOTE: the vendor states 'As RFC7636 is an extension, I think the claim in the Readme of \"RFC 6749 compliant\" is valid and not misleading and I also therefore wouldn't describe this as a \"vulnerability\" with the library per se.'\"",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/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-2017-18924"
}, {
"type" : "WEB",
"url" : "https://github.com/oauthjs/node-oauth2-server/issues/637"
}, {
"type" : "WEB",
"url" : "https://github.com/oauthjs/node-oauth2-server/pull/452"
}, {
"type" : "WEB",
"url" : "https://codeburst.io/missing-the-point-in-securing-oauth-2-0-83968708b467"
}, {
"type" : "WEB",
"url" : "https://tools.ietf.org/html/draft-ietf-oauth-security-topics-15"
}, {
"type" : "WEB",
"url" : "https://tools.ietf.org/html/rfc7636"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-04-21T21:15:38Z",
"nvd_published_at" : "2020-10-04T05:15:00Z"
}
}