Skip to content
Heist/ feed
Back to feed
High

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

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-73643
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 15:00 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 13 Aug 2026, 17:47 UTC

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.

osv:CVE-2026-73643
Complete source record
{
  "id": "420dc76855d4ca4745a5c7a911de4dcc676e98e8d6f3c15b5389c50bb07d5256",
  "url": "https://osv.dev/vulnerability/CVE-2026-73643",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "js-yaml: Exponential parsing time in the flow collections leads to denial of service",
    "summary": "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.",
    "evidence": "osv:CVE-2026-73643",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-73643",
      "aliases": [
        "CVE-2026-73643",
        "GHSA-pm4m-ph32-ghv5"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/nodeca/js-yaml",
              "type": "GIT",
              "events": [
                {
                  "introduced": "75148bc4f5eb69b3d338e1c355d8bb2dba5bdf34"
                },
                {
                  "fixed": "3c2955942ef3a8c4b1e3cb9a5e64ba38012360ea"
                },
                {
                  "fixed": "3e5240f9cbe645ce5afb58524954a13c8539c853"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "5.0.0"
                      },
                      {
                        "fixed": "5.2.2"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "3e5240f9cbe645ce5afb58524954a13c8539c853"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "5.2.1",
            "5.2.0",
            "5.1.0",
            "5.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-73643.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:36.555648608Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/73xxx/CVE-2026-73643.json",
        "https://github.com/nodeca/js-yaml/security/advisories/GHSA-pm4m-ph32-ghv5",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-73643",
        "https://github.com/nodeca/js-yaml/commit/3e5240f9cbe645ce5afb58524954a13c8539c853"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-407"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/73xxx/CVE-2026-73643.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-73643",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 503922,
  "published_at": "2026-08-13T17:47:30.404+00:00"
}