9.3critical
Apostrophe has default XSS via `xmp` raw-text passthrough in `sanitize-html`
- Severity
- 9.3critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.68% (higher than 53% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-rpr9-rxv7-x643
Description
ApostropheCMS is an open-source Node.js content management system, and sanitize-html provides a simple HTML sanitizer with a clear API. Under the default configuration, versions of `sanitize-html` prior to 2.17.4 can turn attacker-controlled content inside a disallowed `xmp` element into live HTML or JavaScript. This is a sanitizer bypass in the default `disallowedTagsMode: 'discard'` path and can lead to stored XSS in applications that render sanitized output back to users. Version 2.17.4 patches the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| apostrophecms sanitize-html | < 2.17.4 | CVE List |
| multicluster-engine/console-mce-rhel9 | Not specified Not affected: from 1784312384 before *, from 1786911977 before *, from 1786668856 before *, from 1783351002 before *, from 1785078604 before *, from 1783348181 before * | CVE List |
| rhacm2/console-rhel9 | Not specified Not affected: from 1783350952 before *, from 1785078581 before *, from 1783451729 before *, from 1784578812 before *, from 1786908361 before *, from 1787335105 before * | CVE List |
| container-native-virtualization/kubevirt-console-plugin-rhel9 | Not specified Not affected: from 1784844382 before *, from 1784629964 before * | CVE List |
| openshift4/ose-console-rhel9 | Not specified Not affected: from 1788350963 before *, from 1788359934 before *, from 1787746382 before * | CVE List |
| devspaces/dashboard-rhel9 | Not specified Not affected: from 1784737150 before * | CVE List |
| quay/quay-rhel8 | Not specified Not affected: from 1783750447 before *, from 1783751865 before *, from 1784353904 before *, from 1784351966 before *, from 1784125838 before * | CVE List |
| quay/quay-rhel9 | Not specified Not affected: from 1783955846 before * | CVE List |
| satellite/iop-host-inventory-frontend-rhel9 | Not specified Not affected: from 1785922764 before *, from 1785956497 before * | CVE List |
| satellite/iop-vulnerability-frontend-rhel9 | Not specified Not affected: from 1785937325 before * | CVE List |
| opentelemetry-collector | Not specified | CVE List |
| opentelemetry-collector-contrib | Not specified | CVE List |
| rhoai/odh-mlflow-rhel9 | Not specified | CVE List |
| openshift4/ose-agent-installer-ui-rhel9 | Not specified | CVE List |
| openshift4/ose-console | Not specified | CVE List |
| nodejs-sanitize-html | Not specified | CVE List |
| satellite/iop-advisor-frontend-rhel9 | Not specified | CVE List |
| sanitize-html (npm) | from 2.17.3 before 2.17.4 | GitHub Advisory Database |
All scores
| GitHub_M | 9.3critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N |
| redhat-SADP | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N |
| GitHub | 9.3critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
ApostropheCMS is an open-source Node.js content management system, and sanitize-html provides a simple HTML sanitizer with a clear API. Under the default configuration, versions of `sanitize-html` prior to 2.17.4 can turn attacker-controlled content inside a disallowed `xmp` element into live HTML or JavaScript. This is a sanitizer bypass in the default `disallowedTagsMode: 'discard'` path and can lead to stored XSS in applications that render sanitized output back to users. Version 2.17.4 patches the issue.
GitHub Advisory Database
Summary
Under the default configuration, sanitize-html can turn attacker-controlled content inside a disallowed xmp element into live HTML or JavaScript. This is a sanitizer bypass in the default disallowedTagsMode: 'discard' path and can lead to stored XSS in applications that render sanitized output back to users.
Details
In sanitize-html@2.17.3, the default nonTextTags list includes only script, style, textarea, and option in index.js lines 138-142. That means disallowed xmp tags are not treated as "drop the entire contents" tags.
Later, in the ontext handler at index.js lines 569-577, the code special-cases textarea and xmp and appends their text content directly to the output without escaping:
} else if ((options.disallowedTagsMode === 'discard' || options.disallowedTagsMode === 'completelyDiscard') && (tag === 'textarea' || tag === 'xmp')) {
result += text;
}
Because htmlparser2 treats xmp as a raw-text element, markup inside xmp is parsed as text on input but becomes live markup again once it is appended unescaped to the sanitized output.
This creates a default sanitizer bypass. For example, a disallowed <xmp> wrapper can be used to smuggle <script> or event-handler payloads through sanitization.
The README also appears to contradict the implementation. In the "Discarding the entire contents of a disallowed tag" section, the documented exception list names only style, script, textarea, and option, and does not mention xmp.
PoC
Tested locally against sanitize-html@2.17.3 on Node.js v25.2.1.
- Install the package:
npm install sanitize-html
- Run the following script:
const sanitizeHtml = require('sanitize-html');
console.log(sanitizeHtml('<xmp><script>alert(1)</script></xmp>'));
console.log(sanitizeHtml('<xmp><img src=x onerror=alert(1)></xmp>'));
console.log(sanitizeHtml('<xmp><svg><script>alert(1)</script></svg></xmp>'));
- Observed output:
<script>alert(1)</script>
<img src=x onerror=alert(1)>
<svg><script>alert(1)</script></svg>
- Render any of the returned strings in a browser context that trusts
sanitize-htmloutput, for example:
const dirty = '<xmp><script>alert(1)</script></xmp>';
const clean = sanitizeHtml(dirty);
If clean is inserted into the DOM or stored and later rendered as trusted HTML, the attacker-controlled script executes.
Impact
This is a cross-site scripting vulnerability in the default sanitizer behavior. Any application that uses sanitize-html defaults and then renders the returned HTML as trusted output is impacted. A remote attacker who can submit HTML content can trigger execution of arbitrary JavaScript in another user's browser when that content is viewed.
NVD (es)
ApostropheCMS es un sistema de gestión de contenido de código abierto basado en Node.js, y sanitize-html proporciona un saneador de HTML simple con una API clara. Bajo la configuración predeterminada, las versiones de sanitize-html anteriores a la 2.17.4 pueden convertir contenido controlado por el atacante dentro de un elemento xmp no permitido en HTML o JavaScript en vivo. Esto es un bypass del saneador en la ruta predeterminada disallowedTagsMode: ’discard’ y puede llevar a XSS almacenado en aplicaciones que renderizan la salida saneada de vuelta a los usuarios. La versión 2.17.4 corrige el problema.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-44990 changed 2026-09-10 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-rpr9-rxv7-x643 changed 2026-06-12 | CC-BY-4.0 |
| NVD | CVE-2026-44990 changed 2026-10-26 | Public domain |