CVE-2026-27942: Fast xml parser Fast-xml-parser Has Stack Overflow Vulnerability

LOW
Advisory Identifier: GHSA-fj3w-jwp8-x2g3
CWE-120
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-27942
GHSA Identifier GHSA-fj3w-jwp8-x2g3
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
Affected Product Fast xml parser
Package Ecosystem npm
Published Date
Last Updated

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.

fast-xml-parser fixed: 5.3.8
npm install fast-xml-parser@5.3.8
fast-xml-parser fixed: 4.5.4
npm install fast-xml-parser@4.5.4
Verify Direct and Transitive Dependencies

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

### 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)

CVE-2026-27942 Affected Fast xml parser Versions

2 component(s)
Fixed Versions:
5.3.84.5.4
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?
CVE-2026-27942 is a security vulnerability in Fast xml parser involving fast-xml-parser has stack overflow in XMLBuilder with preserveOrder under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow').
Which Fast xml parser versions are affected?
Affected versions include releases prior to 5.3.8, 4.5.4 across affected packages: fast-xml-parser.
What version fixes CVE-2026-27942?
Upgrading to 5.3.8, 4.5.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is fast-xml-parser affected?
Yes, fast-xml-parser is affected in releases prior to 5.3.8, 4.5.4. Upgrade your dependency to 5.3.8, 4.5.4 or later.
What CWE is associated with CVE-2026-27942?
CVE-2026-27942 is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') (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.).
How can I check npm dependencies for CVE-2026-27942?
Run the dependency tree command: 'npm ls fast-xml-parser'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}