---
title: "GHSA-fj3w-jwp8-x2g3: fast-xml-parser has stack overflow in XMLBuilder with preserveOrder"
description: "Low severity. fast-xml-parser has stack overflow in XMLBuilder with preserveOrder. Affects fast-xml-parser; fixed in 5.3.8."
url: https://inlinr.com/advisories/GHSA-fj3w-jwp8-x2g3
lang: en
---

[Packages](https://inlinr.com/packages) / [fast-xml-parser](https://inlinr.com/packages/fast-xml-parser) / [Security](https://inlinr.com/packages/fast-xml-parser/security)

Low Vulnerability GHSA-fj3w-jwp8-x2g3 CVE-2026-27942 Published 26 Feb 2026

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

Your version 

Affected releases · [fast-xml-parser](https://inlinr.com/packages/fast-xml-parser)

- 5.x 5.0.0 – 5.3.7 Fixed in 5.3.8
- 4.x 4.0.0 – 4.5.3 Fixed 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?_](https://github.com/NaturalIntelligence/fast-xml-parser/pull/791 "https://github.com/NaturalIntelligence/fast-xml-parser/pull/791")

## How it is exploited

Exploitable over the network, with no account and no action from a user.

- **Confidentiality**: none
- **Integrity**: none
- **Availability**: low

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

## References

- [Reference](https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-fj3w-jwp8-x2g3 "https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-fj3w-jwp8-x2g3")  
github.com/NaturalIntelligence/fast-xml-parser/…
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-27942 "https://nvd.nist.gov/vuln/detail/CVE-2026-27942")  
nvd.nist.gov/vuln/detail/CVE-2026-27942
- [Pull request](https://github.com/NaturalIntelligence/fast-xml-parser/pull/791 "https://github.com/NaturalIntelligence/fast-xml-parser/pull/791")  
#791
- [Fix commit](https://github.com/NaturalIntelligence/fast-xml-parser/commit/c13a961910f14986295dd28484eee830fa1a0e8a "https://github.com/NaturalIntelligence/fast-xml-parser/commit/c13a961910f14986295dd28484eee830fa1a0e8a")  
c13a961
- [Package](https://github.com/NaturalIntelligence/fast-xml-parser "https://github.com/NaturalIntelligence/fast-xml-parser")  
github.com/NaturalIntelligence/fast-xml-parser

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
