NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2026-27942: fast-xml-parser has stack overflow in XMLBuilder with preserveOrder

lowCVSS 4.0 2.7GHSA-fj3w-jwp8-x2g3

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

_Are there any links users can visit to find out more?_

Credited to julianladisch.

References

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 entries