CVE-2023-34104 Regex Injection via Doctype Entities
An attacker can cause indefinite parser stalls via crafted entity names in fast-xml-parser, leading to denial of service.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-34104?
CVE-2023-34104 is a high-severity denial of service vulnerability in NaturalIntelligence fast-xml-parser, published on 6 Jun 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
fast-xml-parser is an open source, pure javascript xml parser. fast-xml-parser allows special characters in entity names, which are not escaped or sanitized. Since the entity name is used for creating a regex for searching and replacing entities in the XML body, an attacker can abuse it for denial of service (DoS) attacks. By crafting an entity name that results in an intentionally bad performing regex and utilizing it in the entity replacement step of the parser, this can cause the parser to stall for an indefinite amount of time. This problem has been resolved in v4.2.4. Users are advised to upgrade. Users unable to upgrade should avoid using DOCTYPE parsing by setting the `processEntities: false` option.
Which versions are affected by CVE-2023-34104?
2 open source packages ship an affected version, including fast-xml-parser. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
fast-xml-parser npm | From 4.1.3 | 4.2.4 |
fast-xml-parser npm | From 4.1.3 | 4.2.4 |
Products include Naturalintelligence Fast-Xml-Parser.
How do I fix CVE-2023-34104?
Upgrade fast-xml-parser to 4.2.4 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2023-34104 being exploited?
There is no known exploitation of CVE-2023-34104 in the wild and no public exploit code.
Other vulnerabilities in NaturalIntelligence fast-xml-parser
- CVE-2026-25896 fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names
- CVE-2026-33036 fast-xml-parser affected by numeric entity expansion bypassing all entity expansion limits (incomplete fix for CVE-2026-26278)
- CVE-2026-26278 fast-xml-parser affected by DoS through entity expansion in DOCTYPE (no expansion limit)
- CVE-2026-25128 fast-xml-parser has RangeError DoS Numeric Entities Bug
- CVE-2024-41818 ReDOS at currency parsing fast-xml-parser
Sources
Also known as GHSA-6w63-h3fj-q4vw.