CVE-2020-7608: Yargs parser Yargs-parser Vulnerable To Prototype Pollution Vulnerability
MODERATECVE-2020-7608 is a MODERATE (CVSS 5.3) yargs-parser vulnerable to prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Yargs parser libraries in the npm ecosystem. The issue involves yargs-parser vulnerable to prototype pollution. Remediation is available by upgrading affected packages to version 13.1.2, 15.0.1, 18.1.1, 5.0.1.
CVE-2020-7608 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2020-7608
To remediate this vulnerability, upgrade all affected Yargs parser 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 yargs-parser@13.1.2
npm install yargs-parser@15.0.1
npm install yargs-parser@18.1.1
npm install yargs-parser@5.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls yargs-parser
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-7608, inspect your project dependencies using npm:
npm ls yargs-parser
Analyze the terminal output to locate any version of Yargs parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 13.1.2), your application is affected.
Note: The npm ls yargs-parser 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-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Yargs parser, 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-7608 Affected Yargs parser Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
yargs-parser
|
npm |
≥ 6.0.0
< 13.1.2
|
13.1.2
|
|
yargs-parser
|
npm |
≥ 14.0.0
< 15.0.1
|
15.0.1
|
|
yargs-parser
|
npm |
≥ 16.0.0
< 18.1.1
|
18.1.1
|
|
yargs-parser
|
npm |
< 5.0.1
|
5.0.1
|
References
Frequently Asked Questions
What is CVE-2020-7608?
Which Yargs parser versions are affected?
What version fixes CVE-2020-7608?
Is yargs-parser affected?
What is the CVSS score of CVE-2020-7608?
What CWE is associated with CVE-2020-7608?
How can I check npm dependencies for CVE-2020-7608?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-p9pc-299p-vxgp",
"modified" : "2022-08-02T21:44:02Z",
"published" : "2020-09-04T18:00:54Z",
"aliases" : [ "CVE-2020-7608" ],
"summary" : "yargs-parser Vulnerable to Prototype Pollution",
"details" : "Affected versions of `yargs-parser` are vulnerable to prototype pollution. Arguments are not properly sanitized, allowing an attacker to modify the prototype of `Object`, causing the addition or modification of an existing property that will exist on all objects. \nParsing the argument `--foo.__proto__.bar baz'` adds a `bar` property with value `baz` to all objects. This is only exploitable if attackers have control over the arguments being passed to `yargs-parser`.\n\n\n\n## Recommendation\n\nUpgrade to versions 13.1.2, 15.0.1, 18.1.1 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "yargs-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "13.1.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "yargs-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "14.0.0"
}, {
"fixed" : "15.0.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "yargs-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "16.0.0"
}, {
"fixed" : "18.1.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "yargs-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.0.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 5.0.0"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-7608"
}, {
"type" : "WEB",
"url" : "https://github.com/yargs/yargs-parser/commit/1c417bd0b42b09c475ee881e36d292af4fa2cc36"
}, {
"type" : "WEB",
"url" : "https://github.com/yargs/yargs-parser/commit/63810ca1ae1a24b08293a4d971e70e058c7a41e2"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/yargs/yargs-parser"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-YARGSPARSER-560381"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/1500"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321", "CWE-915" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T19:01:32Z",
"nvd_published_at" : "2020-03-16T20:15:00Z"
}
}