js-yaml has prototype pollution in merge (<<)
Affected releases · js-yaml
- 4.x4.0.0 – 4.1.0Fixed in 4.1.1
- 3.x3.0.0 – 3.14.1Fixed in 3.14.2
- 2.x and older0.2.0 – 2.1.3No fix, no longer updated
On 4.x, the newest line:
npm install js-yaml@4.1.1Every release on a timeline
Not affected
5.0.0 – 5.5.0
12 releases, latest
Affected
4.0.0 – 4.1.0
2 releases
Fixed
4.1.1 – 4.3.2
5 releases
Affected
3.0.0 – 3.14.1
46 releases
Fixed
3.14.2 – 3.15.2
4 releases
Affected
2.0.0 – 2.1.3
10 releases
Affected
1.0.0 – 1.0.3
4 releases
Affected
0.2.0 – 0.3.7
11 releases
What happens
Impact
In js-yaml 4.1.0, 4.0.0, and 3.14.1 and below, it's possible for an attacker to modify the prototype of the result of a parsed yaml document via prototype pollution (__proto__). All users who parse untrusted yaml documents may be impacted.
Patches
Problem is patched in js-yaml 4.1.1 and 3.14.2.
Workarounds
You can protect against this kind of attack on the server by using node --disable-proto=delete or deno (in Deno, pollution protection is on by default).
References