CVE-2026-73643 in js-yamlinfo

Summary

by MITRE • 08/13/2026

js-yaml is a JavaScript YAML parser and dumper. From 5.0.0 until 5.2.2, parsing a small YAML document can take exponential time when an application calls load() or loadAll() on untrusted input. In src/parser/parser.ts, readFlowCollection uses restoreState and calls parseNode a second time when a flow-sequence entry is recognized as a key: value pair. If the key is a nested flow sequence of the same shape, every level is parsed twice, causing O(2^n) work and allowing an input under 200 bytes to keep one CPU busy for minutes, block the Node.js event loop, and stall the process. No anchors, aliases, merges, tags, or nondefault options are required. This issue is fixed in version 5.2.2.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 08/13/2026

The js-yaml library vulnerability represents a critical performance degradation issue that can lead to denial of service conditions in applications processing untrusted YAML input. This flaw exists specifically in versions 5.0.0 through 5.2.1 where the parser exhibits exponential time complexity when handling certain YAML structures. The vulnerability stems from how the parser manages flow collection parsing, particularly in the readFlowCollection function within src/parser/parser.ts. When the parser encounters a flow sequence entry that is subsequently identified as a key-value pair, it employs a mechanism called restoreState that triggers parseNode to be executed twice for the same element. This recursive double-parsing behavior creates a cascading effect where nested flow sequences of identical structure cause each level to be processed multiple times, resulting in O(2^n) computational complexity.

The operational impact of this vulnerability extends beyond simple performance degradation to potential system compromise through resource exhaustion attacks. An attacker can craft a YAML payload under 200 bytes that will cause a single CPU core to remain occupied for extended periods, effectively blocking the Node.js event loop and rendering the application unresponsive. This behavior demonstrates characteristics consistent with a denial of service attack vector where computational resources are consumed in a manner that prevents legitimate operations from completing. The vulnerability is particularly concerning because it requires no special YAML features such as anchors, aliases, merges, tags, or non-default parsing options to exploit, making it accessible to attackers who can simply provide malformed input to trigger the condition.

From a security standards perspective, this vulnerability aligns with CWE-400 which describes "Uncontrolled Resource Consumption" and specifically relates to the improper handling of input data that leads to excessive computational requirements. The attack pattern also corresponds to techniques described in MITRE ATT&CK framework under T1496 for "Resource Exhaustion" and potentially T1211 for "Exploitation for Defense Evasion" when such attacks are used to maintain persistent system instability. The exponential time complexity makes this vulnerability particularly dangerous in multi-threaded environments where a single malicious input can consume CPU resources across multiple threads, amplifying the impact on system availability. Organizations using js-yaml versions 5.0.0 through 5.2.1 should immediately implement mitigation strategies including input validation, rate limiting, and application-level timeouts to prevent exploitation while planning migration to version 5.2.2 or later where the issue has been resolved through improved parsing algorithms that eliminate the redundant parsing operations causing the exponential behavior.

The fix implemented in version 5.2.2 addresses the root cause by modifying how flow collections are processed during parsing, specifically by removing the redundant state restoration and second parseNode invocation that created the exponential complexity. This change ensures that each element is parsed exactly once regardless of its position within nested structures, eliminating the possibility for attackers to craft inputs that would trigger the O(2^n) behavior. The resolution demonstrates proper defensive programming practices where input validation and efficient parsing algorithms work together to prevent resource exhaustion attacks while maintaining backward compatibility with legitimate YAML parsing requirements.

Responsible

GitHub M

Reservation

08/13/2026

Disclosure

08/13/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!