Inefficient Algorithmic Complexityjs-yaml is a human-friendly data serialization language.
Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in the readFlowCollection function of parser.ts, which reaches exponential time when a flow sequence entry turns out to be a key: value pair and the parser rewinds to parse that entry a second time as the key. An attacker can exhaust CPU and block the Node event loop by supplying a small YAML document, under 200 bytes, with deeply nested flow sequences of key: value entries, since the re-parsing makes the work grow as O(2^n) in nesting depth. Exploitation occurs under the default configuration when the application parses untrusted YAML with load() or loadAll(), and needs no special schema, anchors, aliases, or merge keys.
How to fix Inefficient Algorithmic Complexity? Upgrade js-yaml to version 5.2.2 or higher.
| |
Inefficient Algorithmic Complexityjs-yaml is a human-friendly data serialization language.
Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in the omapTag.addItem() function of src/tag/sequence/omap.ts, which performs a linear scan for duplicate keys on every insertion into an ordered map. An attacker can block the Node.js event loop and cause denial of service by supplying an !!omap value with many entries, around 50,000 in a roughly 2 MB document, which forces O(n²) duplicate-key checks. Exploitation requires the application to parse untrusted YAML with the YAML 1.1 schema (yaml.load(input, { schema: yaml.YAML11_SCHEMA })), under which the !!omap tag is resolved.
How to fix Inefficient Algorithmic Complexity? Upgrade js-yaml to version 5.2.1 or higher.
| |