Packages / fast-xml-parser / Security

LowVulnerabilityGHSA-fj3w-jwp8-x2g3CVE-2026-27942Published 26 Feb 2026

fast-xml-parser has stack overflow in XMLBuilder with preserveOrder

Your version

Affected releases · fast-xml-parser

  • 5.x5.0.0 – 5.3.7Fixed in 5.3.8
  • 4.x4.0.0 – 4.5.3Fixed in 4.5.4

On 5.x, the newest line:

npm install fast-xml-parser@5.3.8
Every release on a timeline
5.x
  1. Affected

    5.0.0 – 5.3.7

    25 releases

  2. Fixed

    5.3.8 – 5.12.1

    35 releases, latest

4.x
  1. Affected

    4.0.0 – 4.5.3

    42 releases

  2. Fixed

    4.5.4 – 4.5.7

    4 releases

195 stable releases of fast-xml-parser, oldest to newest, one row per major.

What happens

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?

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.