XHTML Purifier Library Node.js Vulnerability Leading to Cross-Site Scripting
CVE-2026-61784
6.1MEDIUM
What is CVE-2026-61784?
The XHTML Purifier library, used for cleaning raw HTML input, has a vulnerability in versions prior to 0.4.3 that allows attackers to inject arbitrary attributes into sanitized output. Specifically, the library fails to HTML-entity-encode attribute values when serializing, which can enable the insertion of JavaScript event handlers through attributes like class, style, or href. This bypass of the sanitizer can lead to cross-site scripting attacks, allowing malicious scripts to execute in a user's browser when rendered. The issue is resolved in version 0.4.3 where proper encoding measures were implemented.
Affected Version(s)
node-xhtml-purifier < 0.4.3
