Description
@xmldom/xmldom’s processing-instruction (PI) grammar regex exhibits quadratic-time backtracking (ReDoS) when parsing an unterminated processing instruction. A single small XML document containing <? + a target + a long run of whitespace and no closing ?> forces the regular expression engine into O(n²) work, stalling the Node.js event loop.
Recommendation
Update the @xmldom/xmldom package to the latest compatible version. Followings are version details:
- Affected version(s): >= 0.9.0-beta.9, <= 0.9.10
- Patched version(s): 0.9.11
References
Could your website be exposed too?
SmartScanner can check your website for xmldom PI grammar regex ReDoS: quadratic backtracking on unterminated processing instructions and gives you actionable findings to investigate.
Start a free scanRelated Issues
- xmldom: End-tag Whitespace-Trim Regex ReDoS — quadratic backtracking in the 0.8.x end-tag parser - CVE-2026-83619
- LiquidJS Vulnerable to ReDoS via Quadratic Backtracking in `strip_html` Filter Regex - CVE-2026-45617
- xmldom: Processing Instruction Target Injection Bypasses requireWellFormed - CVE-2026-83616
- xmldom: Quadratic-time parsing via the malformed-input recovery path — `parseElementStartPart` re-scan and `normalize()` - CVE-2026-83614


