Packages / yargs-parser / Security
yargs-parser Vulnerable to Prototype Pollution
Affected releases · yargs-parser
- 18.x18.0.0 – 18.1.0Fixed in 18.1.1
- 17.x to 16.x16.0.0 – 17.1.0No fix, no longer updated
- 15.x15.0.0Fixed in 15.0.1
- 14.x14.0.0No fix on this line yet
- 13.x13.0.0 – 13.1.1Fixed in 13.1.2
- 12.x to 6.x6.0.0 – 12.0.0No fix, no longer updated
- 5.x5.0.0Fixed in 5.0.1
- 4.x and older1.0.0 – 4.2.1No fix, no longer updated
On 18.x, the newest line:
npm install yargs-parser@18.1.1Every release on a timeline
Not affected
22.0.0
1 release, latest
Affected
18.0.0 – 18.1.0
2 releases
Fixed
18.1.1 – 18.1.3
3 releases
Affected
17.0.0 – 17.1.0
3 releases
Affected
16.0.0 – 16.1.0
2 releases
Affected
15.0.0
1 release
Fixed
15.0.1 – 15.0.3
3 releases
Affected
14.0.0
1 release
Affected
13.0.0 – 13.1.1
3 releases
Fixed
13.1.2
1 release
Affected
12.0.0
1 release
Affected
11.0.0 – 11.1.1
3 releases
Affected
10.0.0 – 10.1.0
2 releases
Affected
9.0.0 – 9.0.2
3 releases
Affected
8.0.0 – 8.1.0
2 releases
Affected
7.0.0
1 release
Affected
6.0.0 – 6.0.1
2 releases
Affected
5.0.0
1 release
Fixed
5.0.1
1 release
Affected
4.0.0 – 4.2.1
6 releases
Affected
3.1.0 – 3.2.0
2 releases
Affected
2.0.0 – 2.4.1
7 releases
Affected
1.0.0 – 1.1.0
2 releases
What happens
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.
Parsing 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.
Recommendation
Upgrade to versions 13.1.2, 15.0.1, 18.1.1 or later.