REDHAT-BUG-2498130: High severity npm/js-yaml vulnerability
js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 before 5.2.1, YAML11SCHEMA support for the !!omap tag in src/tag/sequence/omap.ts uses omapTag.addItem() to perform a linear duplicate-key scan on every insertion, causing O(n^2) CPU consumption when yaml.load() parses a crafted ordered-map document. This issue is fixed in version 5.2.1.
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 5.2.1
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Deployments using npm/js-yaml versions from 5.0.0 before 5.2.1 are affected when YAML11_SCHEMA support is used to parse ordered maps with the !!omap tag.
What must an attacker provide to trigger the problem?
An attacker needs to cause yaml.load() to parse a crafted ordered-map YAML document containing !!omap data. The duplicate-key handling performs a linear scan for each insertion, producing quadratic CPU consumption.
What should be done to remediate the issue?
Upgrade js-yaml to version 5.2.1, which fixes the issue.