CVE-2026-27942: Fast xml parser Fast-xml-parser Has Stack Overflow Vulnerability
LOWCVE-2026-27942 is a LOW fast-xml-parser has stack overflow vulnerability (CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')) affecting Fast xml parser libraries in the npm ecosystem. The issue involves fast-xml-parser has stack overflow in xmlbuilder with preserveorder. Remediation is available by upgrading affected packages to version 5.3.8, 4.5.4.
CVE-2026-27942 at a Glance
How to Fix CVE-2026-27942
To remediate this vulnerability, upgrade all affected Fast xml parser dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install fast-xml-parser@5.3.8
npm install fast-xml-parser@4.5.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls fast-xml-parser
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-27942, inspect your project dependencies using npm:
npm ls fast-xml-parser
Analyze the terminal output to locate any version of Fast xml parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.3.8), your application is affected.
Note: The npm ls fast-xml-parser command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow'), where the product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer. In Fast xml parser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-27942 Affected Fast xml parser Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
fast-xml-parser
|
npm |
≥ 5.0.0
< 5.3.8
|
5.3.8
|
|
fast-xml-parser
|
npm |
≥ 4.0.0-beta.0
< 4.5.4
|
4.5.4
|
References
Frequently Asked Questions
What is CVE-2026-27942?
Which Fast xml parser versions are affected?
What version fixes CVE-2026-27942?
Is fast-xml-parser affected?
What CWE is associated with CVE-2026-27942?
How can I check npm dependencies for CVE-2026-27942?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fj3w-jwp8-x2g3",
"modified" : "2026-03-06T22:00:11Z",
"published" : "2026-02-26T22:33:10Z",
"aliases" : [ "CVE-2026-27942" ],
"summary" : "fast-xml-parser has stack overflow in XMLBuilder with preserveOrder",
"details" : "### Impact\nApplication crashes with stack overflow when user use XML builder with `prserveOrder:true` for following or similar input \n\n```\n[{\n 'foo': [\n { 'bar': [{ '@_V': 'baz' }] }\n ]\n}]\n```\n\nCause: `arrToStr` was not validating if the input is an array or a string and treating all non-array values as text content.\n_What kind of vulnerability is it? Who is impacted?_\n\n### Patches\nYes in 5.3.8\n\n### Workarounds\nUse XML builder with `preserveOrder:false` or check the input data before passing to builder.\n\n### References\n[_Are there any links users can visit to find out more?_](https://github.com/NaturalIntelligence/fast-xml-parser/pull/791)",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "fast-xml-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0"
}, {
"fixed" : "5.3.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "fast-xml-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0-beta.0"
}, {
"fixed" : "4.5.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-fj3w-jwp8-x2g3"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27942"
}, {
"type" : "WEB",
"url" : "https://github.com/NaturalIntelligence/fast-xml-parser/pull/791"
}, {
"type" : "WEB",
"url" : "https://github.com/NaturalIntelligence/fast-xml-parser/commit/c13a961910f14986295dd28484eee830fa1a0e8a"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/NaturalIntelligence/fast-xml-parser"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-120" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-02-26T22:33:10Z",
"nvd_published_at" : "2026-02-26T02:16:22Z"
}
}