CVE-2023-34104: Regex Injection via Doctype Entities
Impact "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 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.
Patches The problem has been resolved in v4.2.4
Workarounds Avoid using DOCTYPE parsing by processEntities: false option.
Other sources
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.
— MITRE
Natural Intelligence fast-xml-parser is vulnerable to a denial of service, caused by a regular expression denial of service (ReDoS) flaw in the Doctype Entities. By sending a specially crafted regex input, a remote attacker could exploit this vulnerability to cause a denial of service condition.
— IBM
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the vulnerability ID?
The vulnerability ID is CVE-2023-34104.
What is the severity of CVE-2023-34104?
The severity of CVE-2023-34104 is high with a CVSS score of 7.5.
How does the vulnerability in fast-xml-parser affect the software?
The vulnerability in fast-xml-parser allows for a denial of service attack caused by a regular expression denial of service (ReDoS) vulnerability.
Which versions of fast-xml-parser are affected?
Versions up to but excluding 4.2.4 of fast-xml-parser are affected.
How can I fix the vulnerability in fast-xml-parser?
To fix the vulnerability in fast-xml-parser, update to version 4.2.4 or later.