2.7low
fast-xml-parser has stack overflow in XMLBuilder with preserveOrder
- Severity
- 2.7low CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.53% (higher than 46% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-fj3w-jwp8-x2g3
Description
fast-xml-parser allows users to validate XML, parse XML to JS object, or build XML from JS object without C/C++ based libraries and no callback. Prior to version 5.3.8, the application crashes with stack overflow when user use XML builder with `preserveOrder:true`. Version 5.3.8 fixes the issue. As a workaround, use XML builder with `preserveOrder:false` or check the input data before passing to builder.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| NaturalIntelligence fast-xml-parser | < 5.3.8, before 4.5.4, from 5.0.0 before 5.3.8 | CVE List, NVD |
| fast-xml-parser (npm) | from 5.0.0 before 5.3.8, from 4.0.0-beta.0 before 4.5.4 | GitHub Advisory Database |
All scores
| GitHub_M | 2.7low CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U |
| GitHub | low CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
fast-xml-parser allows users to validate XML, parse XML to JS object, or build XML from JS object without C/C++ based libraries and no callback. Prior to version 5.3.8, the application crashes with stack overflow when user use XML builder with `preserveOrder:true`. Version 5.3.8 fixes the issue. As a workaround, use XML builder with `preserveOrder:false` or check the input data before passing to builder.
GitHub Advisory Database
Impact
Application crashes with stack overflow when user use XML builder with prserveOrder:true for following or similar input
[{
'foo': [
{ 'bar': [{ '@_V': 'baz' }] }
]
}]
Cause: arrToStr was not validating if the input is an array or a string and treating all non-array values as text content.
What kind of vulnerability is it? Who is impacted?
Patches
Yes in 5.3.8
Workarounds
Use XML builder with preserveOrder:false or check the input data before passing to builder.
References
NVD (es)
fast-xml-parser permite a los usuarios validar XML, analizar XML a objeto JS o construir XML a partir de un objeto JS sin librerías basadas en C/C++ y sin callback. Antes de la versión 5.3.8, la aplicación falla con desbordamiento de pila cuando el usuario utiliza el constructor de XML con 'preserveOrder:true'. La versión 5.3.8 soluciona el problema. Como solución alternativa, utilice el constructor de XML con 'preserveOrder:false' o verifique los datos de entrada antes de pasarlos al constructor.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-27942 changed 2026-06-23 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-fj3w-jwp8-x2g3 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-27942 changed 2026-06-17 | Public domain |