{"id":"CVE-2026-61784","aliases":["CVE-2026-61784","GHSA-j8r4-32c5-33rc"],"related":[],"kind":"vulnerability","state":"published","title":"xhtml-purifier has HTML attribute-injection (sanitizer bypass) that leads to XSS","summary":"xhtml-purifier is a Node.js library to take in raw/unknown/untrusted HTML and output cleaned, purified, trusted HTML. Versions prior to 0.4.3 do 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 in version 0.4.3 HTML-entity-encodes attribute values before serialization.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"xhtml-purifier is a Node.js library to take in raw/unknown/untrusted HTML and output cleaned, purified, trusted HTML. Versions prior to 0.4.3 do 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 in version 0.4.3 HTML-entity-encodes attribute values before serialization.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"}],"published":"2026-09-24T17:35:57.096Z","modified":"2026-09-30T17:32:07.107Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79","CWE-116"],"affected":[{"ranges":[{"version":"< 0.4.3","status":"affected"}],"vendor":"cstigler","product":"node-xhtml-purifier","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.4.3"}],"ecosystem":"npm","package":"xhtml-purifier","purl":"pkg:npm/xhtml-purifier","source":"ghsa"}],"references":[{"url":"https://github.com/cstigler/node-xhtml-purifier/security/advisories/GHSA-j8r4-32c5-33rc","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/cstigler/node-xhtml-purifier/commit/21d461ad23e7bc9b3073693d5b51b9b8662044d3","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-61784","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/cstigler/node-xhtml-purifier/pull/6","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/cstigler/node-xhtml-purifier","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/cstigler/node-xhtml-purifier/releases/tag/v0.4.3","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-09-24T18:02:51.787Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-61784","url":"https://www.cve.org/CVERecord?id=CVE-2026-61784","licence":"CVE Terms of Use","modified":"2026-09-24T18:03:05.576Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-j8r4-32c5-33rc","url":"https://github.com/advisories/GHSA-j8r4-32c5-33rc","licence":"CC-BY-4.0","modified":"2026-09-24T19:45:04.825Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-61784","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-61784","licence":"Public domain","modified":"2026-09-30T17:32:07.107Z"}],"updatedAt":"2026-11-25T22:59:40.883Z","epss":{"score":0.00178,"percentile":0.07665,"date":"2026-12-01T12:00:22.000Z"}}