p PatchFirst

CVE-2026-73643

CVE-2026-73643 · js-yaml: Exponential parsing time in the flow collections leads to denial of service

This page contains facts from public vulnerability sources. Check the original advisory before updating.

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.

CVSS 7.5 · High · EPSS 0.5% · Fix available

Published
Updated

Stack: system · node

Affected products and versions

  • js-yaml

    Versions
    • >= 5.0.0, < 5.2.2: Affected

    No fix published

  • js-yaml npm

    Affected ranges
    • SEMVER: ≥ 5.0.0, < 5.2.2

    Update to 5.2.2

  • node-js-yaml Ubuntu:18.04:LTS

    Versions
    • 3.9.1+dfsg-1
    • 3.10.0+dfsg-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • node-js-yaml Ubuntu:20.04:LTS

    Versions
    • 3.13.1+dfsg-2
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • node-js-yaml Ubuntu:22.04:LTS

    Versions
    • 3.14.1+dfsg+~3.12.6-2
    • 4.1.0+dfsg+~4.0.5-4ubuntu1
    • 4.1.0+dfsg+~4.0.5-5
    • 4.1.0+dfsg+~4.0.5-6
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • node-js-yaml Ubuntu:24.04:LTS

    Versions
    • 4.1.0+dfsg+~4.0.5-7
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • node-js-yaml Ubuntu:26.10

    Versions
    • 4.1.1+dfsg+~4.0.9-1
    • 4.2.0+~4.0.9-1
    • 4.2.0+~4.0.9-2
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • node-js-yaml Ubuntu:26.04:LTS

    Versions
    • 4.1.0+dfsg+~4.0.5-7
    • 4.1.1+dfsg+~4.0.9-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

Original sources

Check your server →