{"id":"CVE-2026-73643","aliases":["CVE-2026-73643","GHSA-pm4m-ph32-ghv5"],"related":[],"kind":"vulnerability","state":"published","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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nParsing a small YAML document can take exponential time. An application that calls `load()` or `loadAll()` on untrusted input can be hung by a payload under 200 bytes.\n\n### Details\nWhen an entry in a flow sequence turns out to be a `key: value` pair, the parser rewinds and parses that entry a second time as the key.\nIf the key is itself a nested flow sequence of the same shape, every level is parsed twice, so the total work is O(2^n) in the nesting depth. The default `maxDepth` of 100 does not help, because the time is already unmanageable at about 30 to 40 levels.\n\nRoot cause, potentially the: `readFlowCollection` in [parser.ts](https://github.com/nodeca/js-yaml/blob/master/src/parser/parser.ts), the `restoreState` followed by a second `parseNode` further down.\n\n\n### PoC\n\n```javascript\nconst yaml = require('js-yaml')\nconst n = 30\nyaml.load('[ '.repeat(n) + '1' + ' ]: 0'.repeat(n))\n```\n\nWith default options: 22 levels takes about 1 second, 26 levels about 17 seconds, 30 levels over 2 minutes. The input stays under 200 bytes and grows linearly with `n`.\n\n### Impact\nDenial of service. A single small request can keep one CPU busy for minutes or longer and blocks the Node event loop, so one request can stall the whole process. No anchors, aliases, merges, tags, or non default options are required, and it reproduces on the default schema.","format":"markdown","source":"ghsa"},{"lang":"es","text":"js-yaml es un analizador y volcador YAML de JavaScript. Desde la versión 5.0.0 hasta la 5.2.2, el análisis de un documento YAML pequeño puede tomar tiempo exponencial cuando una aplicación llama a load() o loadAll() con una entrada no confiable. En src/parser/parser.ts, readFlowCollection utiliza restoreState y llama a parseNode una segunda vez cuando una entrada de secuencia de flujo se reconoce como un par clave: valor. Si la clave es una secuencia de flujo anidada de la misma forma, cada nivel se analiza dos veces, lo que provoca un trabajo de O(2^n) y permite que una entrada de menos de 200 bytes mantenga una CPU ocupada durante minutos, bloquee el bucle de eventos de Node.js y paralice el proceso. No se requieren anclas, alias, fusiones, etiquetas ni opciones no predeterminadas. Este problema se ha corregido en la versión 5.2.2.","source":"nvd"}],"published":"2026-07-24T16:47:36.000Z","modified":"2026-10-24T15:10:00.190Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-407"],"affected":[{"ranges":[{"version":">= 5.0.0, < 5.2.2","status":"affected"}],"vendor":"nodeca","product":"js-yaml","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"5.0.0","status":"affected","fixed":"5.2.2"}],"ecosystem":"npm","package":"js-yaml","purl":"pkg:npm/js-yaml","source":"ghsa"}],"references":[{"url":"https://github.com/nodeca/js-yaml/security/advisories/GHSA-pm4m-ph32-ghv5","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nodeca/js-yaml/commit/3e5240f9cbe645ce5afb58524954a13c8539c853","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nodeca/js-yaml","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/nodeca/js-yaml/releases/tag/5.2.2","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-08-14T16:43:36.799Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-73643","url":"https://www.cve.org/CVERecord?id=CVE-2026-73643","licence":"CVE Terms of Use","modified":"2026-08-14T16:44:08.839Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pm4m-ph32-ghv5","url":"https://github.com/advisories/GHSA-pm4m-ph32-ghv5","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:11.652Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-73643","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-73643","licence":"Public domain","modified":"2026-10-24T15:10:00.190Z"}],"updatedAt":"2026-11-25T22:59:32.818Z","epss":{"score":0.00344,"percentile":0.29924,"date":"2026-12-01T12:00:22.000Z"}}