CVE-2026-61784: Xhtml purifier Cross-Site Scripting Vulnerability
MODERATECVE-2026-61784 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Xhtml purifier libraries in the npm ecosystem. The issue involves xhtml-purifier has html attribute-injection (sanitizer bypass) that leads to xss. Remediation is available by upgrading affected packages to version 0.4.3.
CVE-2026-61784 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2026-61784
To remediate this vulnerability, upgrade all affected Xhtml purifier dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install xhtml-purifier@0.4.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls xhtml-purifier
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-61784, inspect your project dependencies using npm:
npm ls xhtml-purifier
Analyze the terminal output to locate any version of Xhtml purifier in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.3), your application is affected.
Note: The npm ls xhtml-purifier command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Xhtml purifier, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-61784 Affected Xhtml purifier Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
xhtml-purifier
|
npm |
< 0.4.3
|
0.4.3
|
References
Frequently Asked Questions
What is CVE-2026-61784?
Which Xhtml purifier versions are affected?
What version fixes CVE-2026-61784?
Is xhtml-purifier affected?
What is the CVSS score of CVE-2026-61784?
What CWE is associated with CVE-2026-61784?
How can I check npm dependencies for CVE-2026-61784?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-j8r4-32c5-33rc",
"modified" : "2026-09-24T19:33:24Z",
"published" : "2026-09-24T19:33:23Z",
"aliases" : [ "CVE-2026-61784" ],
"summary" : "xhtml-purifier has HTML attribute-injection (sanitizer bypass) that leads to XSS",
"details" : "xhtml-purifier does not HTML-entity-encode attribute values when serializing its sanitized output. In attributeString() (XHTMLPurifier.js, around line 148) the attribute value is concatenated directly into a double-quoted attribute without encoding. As a result, an attacker-controlled value in any allowed attribute (class, style, title, alt, src, href) can include a double-quote character to break out of the attribute and inject an additional attribute, such as a JavaScript event handler (for example onmouseover or onerror). The injected handler survives sanitization and executes when the output is rendered, which is a sanitizer bypass leading to cross-site scripting. The fix HTML-entity-encodes attribute values before serialization.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "xhtml-purifier"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.4.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.4.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/cstigler/node-xhtml-purifier/security/advisories/GHSA-j8r4-32c5-33rc"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-61784"
}, {
"type" : "WEB",
"url" : "https://github.com/cstigler/node-xhtml-purifier/pull/6"
}, {
"type" : "WEB",
"url" : "https://github.com/cstigler/node-xhtml-purifier/commit/21d461ad23e7bc9b3073693d5b51b9b8662044d3"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/cstigler/node-xhtml-purifier"
}, {
"type" : "WEB",
"url" : "https://github.com/cstigler/node-xhtml-purifier/releases/tag/v0.4.3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-116", "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-09-24T19:33:23Z",
"nvd_published_at" : "2026-09-24T18:17:16Z"
}
}