Skip to content
Heist/ feed
MediumFix available

xhtml-purifier has HTML attribute-injection (sanitizer bypass) that leads to XSS

Type: advisorySource: OSV1 source record

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.

Announced Source revision 1
Original source ↗

GHSA-j8r4-32c5-33rc

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: osv:GHSA-j8r4-32c5-33rc

xhtml-purifier

Source reference: /affected/0/package/name

Affected versions
Not stated in this record
Fixed versions
0.4.3

Source reference: /affected/0/ranges

Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "ranges": [
      {
        "type": "SEMVER",
        "events": [
          {
            "introduced": "0"
          },
          {
            "fixed": "0.4.3"
          }
        ]
      }
    ],
    "package": {
      "name": "xhtml-purifier",
      "purl": "pkg:npm/xhtml-purifier",
      "ecosystem": "npm"
    },
    "database_specific": {
      "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-j8r4-32c5-33rc/GHSA-j8r4-32c5-33rc.json",
      "last_known_affected_version_range": "<= 0.4.1"
    }
  }
]
Related CVEs
CVE-2026-61784

Source reference: /aliases

Publisher severity

No explicit severity was provided.

Linked CVE context

These ratings describe the referenced vulnerabilities and products. They are not a severity rating for every application using this dependency.

CVE-2026-61784 · Medium

node-xhtml-purifier

Event
#14229 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement