Packages / fast-xml-parser / Security
fast-xml-parser vulnerable to Regex Injection via Doctype Entities
Affected releases · fast-xml-parser
- 4.x4.1.3 – 4.2.3Fixed in 4.2.4
On 4.x, the newest line:
npm install fast-xml-parser@4.2.4Every release on a timeline
Not affected
5.0.0 – 5.12.1
60 releases, latest
Not affected
4.0.0 – 4.1.2
19 releases
Affected
4.1.3 – 4.2.3
6 releases
Fixed
4.2.4 – 4.5.7
21 releases
What happens
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.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.