CVE-2026-27942: fast-xml-parser has stack overflow in XMLBuilder with preserveOrder
Impact Application crashes with stack overflow when user use XML builder with prserveOrder:true for following or similar input Cause: arrToStr was not validating if the input is an array or a string and treating all non-array values as text content.
Published Feb 26, 2026 · Updated Mar 6, 2026
Affected packages
fast-xml-parser
- Ecosystem
- npm
- Affected
- >= 5.0.0, < 5.3.8
- Fixed in
- 5.3.8
- Check
npm ls fast-xml-parser
fast-xml-parser
- Ecosystem
- npm
- Affected
- >= 4.0.0-beta.0, < 4.5.4
- Fixed in
- 4.5.4
- Check
npm ls fast-xml-parser
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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
Credited to julianladisch.
References
- https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-fj3w-jwp8-x2g3
- https://nvd.nist.gov/vuln/detail/CVE-2026-27942
- https://github.com/NaturalIntelligence/fast-xml-parser/pull/791
- https://github.com/NaturalIntelligence/fast-xml-parser/commit/c13a961910f14986295dd28484eee830fa1a0e8a
- https://github.com/advisories/GHSA-fj3w-jwp8-x2g3
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-126066
fast-xml-parser: Quadratic CPU consumption scanning unterminated stop-node tags
low3.7Nov 10, 2026CVE-2026-73569
fast-xml-parser: Repeated DOCTYPE declarations reset entity expansion limits
high8.7Jul 21, 2026CVE-2026-41650
fast-xml-parser XMLBuilder: XML Comment and CDATA Injection via Unescaped Delimiters
medium6.1Apr 22, 2026CVE-2026-33349
Entity Expansion Limits Bypassed When Set to Zero Due to JavaScript Falsy Evaluation in fast-xml-parser
medium5.9Mar 19, 2026CVE-2026-33036
fast-xml-parser affected by numeric entity expansion bypassing all entity expansion limits (incomplete fix for CVE-2026-26278)
high7.5Mar 17, 2026CVE-2026-25896
fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names
critical9.3Feb 20, 2026
