CVE-2026-25128: fast-xml-parser Denial of Service Vulnerability Due to RangeError in Numeric Entities
Summary
CVE-2026-25128: fast-xml-parser has RangeError DoS Numeric Entities Bug. Affects fast-xml-parser versions >= 4.3.6, < 5.3.4. Fixed in 5.3.4. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
fast-xml-parser is a popular XML parsing library for Node.js that allows developers to easily convert XML data into JavaScript objects. It is widely used for processing XML payloads in various applications, including API servers, file processors, and message queues. However, the library has a vulnerability that can lead to a Denial of Service (DoS) when handling malformed numeric entities in XML input.
Vulnerability Detail
A RangeError vulnerability exists in the numeric entity processing of fast-xml-parser when parsing XML with out-of-range entity code points (e.g., '�' or '�'). This issue arises from the use of the String.fromCodePoint() method, which throws a RangeError when the code point exceeds the valid Unicode range (0 to 0x10FFFF). The regex patterns used in the parser can capture values far exceeding this range, leading to an uncaught exception that crashes the application. This vulnerability affects any application using fast-xml-parser to process untrusted XML input, resulting in potential service disruption.
How To Fix
Latest published version: 5.11.2 as of 23 Oct 2026
npm install fast-xml-parser@5.11.2
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
5.3.4
This is the first release that contains the fix.
npm install fast-xml-parser@5.3.4
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can implement a try-catch block around the parsing logic to handle potential RangeErrors gracefully. Here is an example of how to modify your server.js file:
const http = require('http');
const { XMLParser } = require('fast-xml-parser');
const parser = new XMLParser({ processEntities: true, htmlEntities: true });
http.createServer((req, res) => {
if (req.method === 'POST' && req.url === '/parse') {
let body = '';
req.on('data', c => body += c);
req.on('end', () => {
try {
const result = parser.parse(body);
res.end(JSON.stringify(result));
} catch (error) {
res.statusCode = 400;
res.end('Invalid XML input');
}
});
} else {
res.end('POST /parse with XML body');
}
}).listen(3000, () => console.log('http://localhost:3000'));
Conclusion
The fast-xml-parser library has a critical vulnerability that can lead to Denial of Service when processing malformed numeric entities in XML input. It is essential to update to the patched version to mitigate this risk. Implementing a try-catch block can serve as a temporary workaround while you update the library.
See every vulnerability recorded for fast-xml-parser →
FAQ
The CVSS score of this vulnerability is 7.5, indicating a high severity level.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application using the Vulert playground without any signup.
Any application using fast-xml-parser to process untrusted XML input is affected, including API servers, file processors, and RSS feed parsers.
If your application encounters this vulnerability, it may crash due to an uncaught RangeError when processing malformed numeric entities.
Yes, a patch is available in version 5.3.4 and later of the fast-xml-parser package.
References
Related vulnerabilities
Recent vulnerabilities recorded for fast-xml-parser.