REDHAT-BUG-2491401: Medium severity npm/js-yaml vulnerability
js-yaml is a JavaScript YAML parser and dumper. Prior to 4.2.0, a crafted YAML document can trigger algorithmic CPU exhaustion in js-yaml merge-key processing (<<) by repeating the same alias many times in a merge sequence. This causes quadratic parse-time behavior relative to input size and can block a Node.js worker/event loop for seconds with a relatively small payload (tens of KB), resulting in denial of service. The issue is in merge handling inside lib/loader.js. This vulnerability is fixed in 4.2.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/js-yamlto a version that resolves this vulnerability.Fixed in 4.2.0
Event History
Frequently Asked Questions
Which installations are affected?
Installations using js-yaml versions prior to 4.2.0 are affected. Version 4.2.0 contains the fix.
What does an attacker need to supply?
An attacker needs to cause the application to parse a crafted YAML document containing repeated instances of the same alias in a merge-key sequence (<<).
How can I determine whether I am exposed?
Check the version of npm/js-yaml used by the application. If it is earlier than 4.2.0 and the application parses attacker-controlled YAML, it is affected.