Every CVE Search/ Get API key

CVE-2026-25896

fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names

9.3 CriticalFix available

fast-xml-parser allows users to validate XML, parse XML to JS object, or build XML from JS object without C/C++ based libraries and no callback. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (<, >, &, ", ') with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
Low
Integrity
High
Availability
None

Exploit likelihood

0.53%Up 0.5 points since Feb 21, 2026
90%50%10%1%

What each source reports

CVE List Score used 9.3

fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names

fast-xml-parser allows users to validate XML, parse XML to JS object, or build XML from JS object without C/C++ based libraries and no callback. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (<, >, &, ", ') with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.

Record
CVE-2026-25896
CVSS 3.1
9.3 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
CVSS 3.1
7.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
Weakness
CWE-185, CWE-79
Updated
2026-11-02
EUVDEUVD-2026-7529 9.3

fast-xml-parser allows users to validate XML, parse XML to JS object, or build XML from JS object without C/C++ based libraries and no callback. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (<, >, &, ", ') with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.

Record
EUVD-2026-7529
CVSS 3.1
9.3 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-m7jm-9gc2-mpf2 9.3

fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names

Entity encoding bypass via regex injection in DOCTYPE entity names

Summary

A dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (&lt;, &gt;, &amp;, &quot;, &apos;) with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered.

Details

The fix for CVE-2023-34104 addressed some regex metacharacters in entity names but missed . (period), which is valid in XML names per the W3C spec.

In DocTypeReader.js, entity names are passed directly to RegExp():

entities[entityName] = {
    regx: RegExp(`&${entityName};`, "g"),
    val: val
};

An entity named l. produces the regex /&l.;/g where . matches any character, including the t in &lt;. Since DOCTYPE entities are replaced before built-in entities, this shadows &lt; entirely.

The same issue exists in OrderedObjParser.js:81 (addExternalEntities), and in the v6 codebase - EntitiesParser.js has a validateEntityName function with a character blacklist, but . is not included:

// v6 EntitiesParser.js line 96
const specialChar = "!?\\/[]$%{}^&*()<>|+";  // no dot

Shadowing all 5 built-in entities

| Entity name | Regex created | Shadows | |---|---|---| | l. | /&l.;/g | &lt; | | g. | /&g.;/g | &gt; | | am. | /&am.;/g | &amp; | | quo. | /&quo.;/g | &quot; | | apo. | /&apo.;/g | &apos; |

PoC

const { XMLParser } = require("fast-xml-parser");

const xml = `<?xml version="1.0"?>
<!DOCTYPE foo [
  <!ENTITY l. "<img src=x onerror=alert(1)>">
]>
<root>
  <text>Hello &lt;b&gt;World&lt;/b&gt;</text>
</root>`;

const result = new XMLParser().parse(xml);
console.log(result.root.text);
// Hello <img src=x onerror=alert(1)>b>World<img src=x onerror=alert(1)>/b>

No special parser options needed - processEntities: true is the default.

When an app renders result.root.text in a page (e.g. innerHTML, template interpolation, SSR), the injected <img onerror> fires.

&amp; can be shadowed too:

const xml2 = `<?xml version="1.0"?>
<!DOCTYPE foo [
  <!ENTITY am. "'; DROP TABLE users;--">
]>
<root>SELECT * FROM t WHERE name='O&amp;Brien'</root>`;

const r = new XMLParser().parse(xml2);
console.log(r.root);
// SELECT * FROM t WHERE name='O'; DROP TABLE users;--Brien'

Impact

This is a complete bypass of XML entity encoding. Any application that parses untrusted XML and uses the output in HTML, SQL, or other injection-sensitive contexts is affected.

  • Default config, no special options
  • Attacker can replace any &lt; / &gt; / &amp; / &quot; / &apos; with arbitrary strings
  • Direct XSS vector when parsed XML content is rendered in a page
  • v5 and v6 both affected

Suggested fix

Escape regex metacharacters before constructing the replacement regex:

const escaped = entityName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
entities[entityName] = {
    regx: RegExp(`&${escaped};`, "g"),
    val: val
};

For v6, add . to the blacklist in validateEntityName:

const specialChar = "!?\\/[].{}^&*()<>|+";

Severity

CWE-185 (Incorrect Regular Expression)

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N - 9.3 (CRITICAL)

Entity decoding is a fundamental trust boundary in XML processing. This completely undermines it with no preconditions.

Record
GHSA-m7jm-9gc2-mpf2
CVSS 3.1
9.3 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
Weakness
CWE-185
Updated
2026-11-02
NVD 9.3

fast-xml-parser allows users to validate XML, parse XML to JS object, or build XML from JS object without C/C++ based libraries and no callback. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (<, >, &, ", ') with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.

Record
CVE-2026-25896
CVSS 3.1
9.3 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
CVSS 3.1
7.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
Weakness
CWE-185, CWE-79
Updated
2026-11-02
OSV 9.3

fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names

fast-xml-parser allows users to validate XML, parse XML to JS object, or build XML from JS object without C/C++ based libraries and no callback. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (<, >, &, ", ') with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.

Record
CVE-2026-25896
CVSS 3.1
9.3 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
Weakness
CWE-185
Updated
2026-11-02
OSVDEBIAN-CVE-2026-25896 9.3

fast-xml-parser allows users to validate XML, parse XML to JS object, or build XML from JS object without C/C++ based libraries and no callback. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (<, >, &, ", ') with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.

Record
DEBIAN-CVE-2026-25896
CVSS 3.1
9.3 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
Updated
2026-11-02
Show 8 moreShow less
OSVGHSA-m7jm-9gc2-mpf2 9.3

fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names

Entity encoding bypass via regex injection in DOCTYPE entity names

Summary

A dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (&lt;, &gt;, &amp;, &quot;, &apos;) with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered.

Details

The fix for CVE-2023-34104 addressed some regex metacharacters in entity names but missed . (period), which is valid in XML names per the W3C spec.

In DocTypeReader.js, entity names are passed directly to RegExp():

entities[entityName] = {
    regx: RegExp(`&${entityName};`, "g"),
    val: val
};

An entity named l. produces the regex /&l.;/g where . matches any character, including the t in &lt;. Since DOCTYPE entities are replaced before built-in entities, this shadows &lt; entirely.

The same issue exists in OrderedObjParser.js:81 (addExternalEntities), and in the v6 codebase - EntitiesParser.js has a validateEntityName function with a character blacklist, but . is not included:

// v6 EntitiesParser.js line 96
const specialChar = "!?\\/[]$%{}^&*()<>|+";  // no dot

Shadowing all 5 built-in entities

| Entity name | Regex created | Shadows | |---|---|---| | l. | /&l.;/g | &lt; | | g. | /&g.;/g | &gt; | | am. | /&am.;/g | &amp; | | quo. | /&quo.;/g | &quot; | | apo. | /&apo.;/g | &apos; |

PoC

const { XMLParser } = require("fast-xml-parser");

const xml = `<?xml version="1.0"?>
<!DOCTYPE foo [
  <!ENTITY l. "<img src=x onerror=alert(1)>">
]>
<root>
  <text>Hello &lt;b&gt;World&lt;/b&gt;</text>
</root>`;

const result = new XMLParser().parse(xml);
console.log(result.root.text);
// Hello <img src=x onerror=alert(1)>b>World<img src=x onerror=alert(1)>/b>

No special parser options needed - processEntities: true is the default.

When an app renders result.root.text in a page (e.g. innerHTML, template interpolation, SSR), the injected <img onerror> fires.

&amp; can be shadowed too:

const xml2 = `<?xml version="1.0"?>
<!DOCTYPE foo [
  <!ENTITY am. "'; DROP TABLE users;--">
]>
<root>SELECT * FROM t WHERE name='O&amp;Brien'</root>`;

const r = new XMLParser().parse(xml2);
console.log(r.root);
// SELECT * FROM t WHERE name='O'; DROP TABLE users;--Brien'

Impact

This is a complete bypass of XML entity encoding. Any application that parses untrusted XML and uses the output in HTML, SQL, or other injection-sensitive contexts is affected.

  • Default config, no special options
  • Attacker can replace any &lt; / &gt; / &amp; / &quot; / &apos; with arbitrary strings
  • Direct XSS vector when parsed XML content is rendered in a page
  • v5 and v6 both affected

Suggested fix

Escape regex metacharacters before constructing the replacement regex:

const escaped = entityName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
entities[entityName] = {
    regx: RegExp(`&${escaped};`, "g"),
    val: val
};

For v6, add . to the blacklist in validateEntityName:

const specialChar = "!?\\/[].{}^&*()<>|+";

Severity

CWE-185 (Incorrect Regular Expression)

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N - 9.3 (CRITICAL)

Entity decoding is a fundamental trust boundary in XML processing. This completely undermines it with no preconditions.

Record
GHSA-m7jm-9gc2-mpf2
CVSS 3.1
9.3 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
Weakness
CWE-185
Updated
2026-11-02
OSVROOT-APP-NPM-CVE-2026-25896 9.3

CVE-2026-25896 in fast-xml-parser - Patched by Root

Root has patched CVE-2026-25896 in the fast-xml-parser package for Root:npm. Multiple fixed versions available.

Record
ROOT-APP-NPM-CVE-2026-25896
CVSS 3.1
9.3 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
Updated
2026-11-02
OSVUBUNTU-CVE-2026-25896 9.3

fast-xml-parser allows users to validate XML, parse XML to JS object, or build XML from JS object without C/C++ based libraries and no callback. From 4.1.3to before 5.3.5, a dot (.) in a DOCTYPE entity name is treated as a regex wildcard during entity replacement, allowing an attacker to shadow built-in XML entities (<, >, &, ", ') with arbitrary values. This bypasses entity encoding and leads to XSS when parsed output is rendered. This vulnerability is fixed in 5.3.5.

Record
UBUNTU-CVE-2026-25896
CVSS 3.1
9.3 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
CVSS 3.1
7.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
Updated
2026-11-02
OSVCLSA-2026-1781744119 No score

TuxCare security update for fast-xml-parser (6 CVEs)

TuxCare rebuilt fast-xml-parser to address 6 CVEs. Fixed in 4.2.7-tuxcare.1.

Record
CLSA-2026-1781744119
Updated
2026-11-02
OSVCLSA-2026-1781744139 No score

TuxCare security update for fast-xml-parser (6 CVEs)

TuxCare rebuilt fast-xml-parser to address 6 CVEs. Fixed in 4.4.0-tuxcare.1.

Record
CLSA-2026-1781744139
Updated
2026-11-05
OSVCLSA-2026-1789376231 No score

TuxCare security update for fast-xml-parser (1 CVE)

TuxCare rebuilt fast-xml-parser to address 1 CVE. Fixed in 4.5.1-tuxcare.2.

Record
CLSA-2026-1789376231
Updated
2026-11-02
OSVCLSA-2026-1792454133 No score

TuxCare security update for fast-xml-parser (7 CVEs)

TuxCare rebuilt fast-xml-parser to address 7 CVEs. Fixed in 5.2.5-tuxcare.1.

Record
CLSA-2026-1792454133
Updated
2026-11-02
OSVCLSA-2026-1792488947 No score

TuxCare security update for fast-xml-parser (3 CVEs)

TuxCare rebuilt fast-xml-parser to address 3 CVEs. Fixed in 4.4.1-tuxcare.1.

Record
CLSA-2026-1792488947
Updated
2026-11-02

Affected products

Show 2 moreShow less

Affected packages

Affected packages
PackageAffectedFixed
fast-xml-parser
npm
5.0.0 up to 5.3.5
5.3.5
fast-xml-parser
npm
4.1.3 up to 4.5.4
4.5.4
fast-xml-parser
TuxCare:npm
From an advisory covering 6 CVEs
4.2.7-tuxcare.0 up to 4.2.7-tuxcare.1, plus listed versions
4.2.7
4.2.7-tuxcare.1
fast-xml-parser
TuxCare:npm
From an advisory covering 6 CVEs
4.4.0-tuxcare.0 up to 4.4.0-tuxcare.1, plus listed versions
4.4.0
4.4.0-tuxcare.1
fast-xml-parser
TuxCare:npm
4.5.1-tuxcare.0 up to 4.5.1-tuxcare.2, plus listed versions
4.5.14.5.1-tuxcare.1
4.5.1-tuxcare.2
fast-xml-parser
TuxCare:npm
From an advisory covering 7 CVEs
5.2.5-tuxcare.0 up to 5.2.5-tuxcare.1, plus listed versions
5.2.5
5.2.5-tuxcare.1
fast-xml-parser
TuxCare:npm
From an advisory covering 3 CVEs
4.4.1-tuxcare.0 up to 4.4.1-tuxcare.1, plus listed versions
4.4.1
4.4.1-tuxcare.1
node-webfont
Debian:12
All versions, plus listed versions
11.4.0+dfsg2+~cs35.7.26-1011.4.0+dfsg2+~cs35.7.26-1111.4.0+dfsg2+~cs35.7.26-1211.4.0+dfsg2+~cs35.7.26-1311.4.0+dfsg2+~cs35.7.26-14
Show 9 moreShow less
11.4.0+dfsg2+~cs35.7.26-1511.4.0+dfsg2+~cs35.7.26-1611.4.0+dfsg2+~cs35.7.26-1811.4.0+dfsg2+~cs35.7.26-1911.4.0+dfsg2+~cs35.7.26-2011.4.0+dfsg2+~cs35.7.26-2111.4.0+dfsg2+~cs35.7.26-711.4.0+dfsg2+~cs35.7.26-811.4.0+dfsg2+~cs35.7.26-9
None known
node-webfont
Debian:13
All versions, plus listed versions
11.4.0+dfsg2+~cs35.7.26-1311.4.0+dfsg2+~cs35.7.26-1411.4.0+dfsg2+~cs35.7.26-1511.4.0+dfsg2+~cs35.7.26-1611.4.0+dfsg2+~cs35.7.26-1811.4.0+dfsg2+~cs35.7.26-1911.4.0+dfsg2+~cs35.7.26-2011.4.0+dfsg2+~cs35.7.26-21
None known
node-webfont
Debian:14
All versions, plus listed versions
11.4.0+dfsg2+~cs35.7.26-1311.4.0+dfsg2+~cs35.7.26-1411.4.0+dfsg2+~cs35.7.26-1511.4.0+dfsg2+~cs35.7.26-1611.4.0+dfsg2+~cs35.7.26-1811.4.0+dfsg2+~cs35.7.26-1911.4.0+dfsg2+~cs35.7.26-2011.4.0+dfsg2+~cs35.7.26-21
None known
Show 6 moreShow less
Affected packages
PackageAffectedFixed
fast-xml-parser
Root:npm
before 4.4.1-aikido.9
4.4.1-aikido.95.2.5-aikido.45.3.4-aikido.75.3.4-aikido.84.2.5-aikido.14.2.5-aikido.24.5.3-aikido.14.5.3-aikido.24.5.1-aikido.14.5.1-aikido.24.5.1-aikido.34.5.1-aikido.44.5.4-aikido.1
@rootio/fast-xml-parser
Root:npm
before 5.3.4-root.io.2
5.3.4-root.io.24.4.1-root.io.25.3.4-root.io.34.4.1-root.io.34.4.1-root.io.45.3.4-root.io.44.4.1-root.io.54.4.1-root.io.64.4.1-root.io.75.3.4-root.io.55.2.5-root.io.24.4.1-root.io.85.2.5-root.io.35.3.4-root.io.64.4.1-root.io.95.2.5-root.io.45.3.4-root.io.75.3.4-root.io.84.2.5-root.io.14.2.5-root.io.24.5.3-root.io.14.5.3-root.io.24.5.1-root.io.14.5.1-root.io.24.5.1-root.io.34.5.1-root.io.44.5.4-root.io.1
node-webfont
Ubuntu:24.04:LTS
All versions, plus listed versions
11.4.0+dfsg2+~cs35.7.26-7ubuntu1
None known
node-webfont
Ubuntu:25.10
All versions, plus listed versions
11.4.0+dfsg2+~cs35.7.26-1011.4.0+dfsg2+~cs35.7.26-13ubuntu2
None known
node-webfont
Ubuntu:26.10
All versions, plus listed versions
11.4.0+dfsg2+~cs35.7.26-1811.4.0+dfsg2+~cs35.7.26-19
None known
node-webfont
Ubuntu:26.04:LTS
All versions, plus listed versions
11.4.0+dfsg2+~cs35.7.26-13ubuntu211.4.0+dfsg2+~cs35.7.26-1411.4.0+dfsg2+~cs35.7.26-1511.4.0+dfsg2+~cs35.7.26-16build111.4.0+dfsg2+~cs35.7.26-18
None known

History

History
RecordedChangedSources
affected
factsOSV
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-25896 is a critical vulnerability (CVSS 9.3) in Naturalintelligence Fast-xml-parser, published February 20, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.53%, the 44th percentile. Fixed in fast-xml-parser 5.3.5.

References

Show 16 moreShow less
MoveEnter Open