REDHAT-BUG-2498114: High severity npm/js-yaml vulnerability
js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 before 5.2.0, when merge keys are enabled, js-yaml can spend quadratic CPU time parsing a document whose size grows only linearly when a chain of mappings uses merge keys where each mapping merges the previous one. This issue is fixed in version 5.2.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 5.2.0
Event History
Frequently Asked Questions
What input is required to trigger the excessive CPU use?
An attacker needs to supply a YAML document containing a chain of mappings that use merge keys, with each mapping merging the previous one. This causes parsing time to grow quadratically while the document size grows linearly.
Is every js-yaml deployment affected?
The issue applies to js-yaml versions from 5.0.0 before 5.2.0 when merge keys are enabled. Deployments not using affected versions or not enabling merge keys are not described as affected.
What version resolves the issue?
Upgrade js-yaml to version 5.2.0 or later. Version 5.2.0 contains the fix.