{"id":"CVE-2026-63670","aliases":["CVE-2026-63670","GHSA-jxwj-j7wr-gfrw"],"related":[],"kind":"vulnerability","state":"published","title":"ApostropheCMS: Mutation-XSS / allowedTags bypass via literal `</textarea/>` solidus close","summary":"ApostropheCMS is an open-source Node.js content management system. Prior to 2.17.6, sanitizeHtml() can pass disallowed executable markup through packages/sanitize-html/index.js when textarea or xmp is included in allowedTags because a literal solidus after the raw-text end-tag name is treated as text by htmlparser2 and the ontext handler emits that content without escaping, while a browser parses the following img onerror markup as active HTML. This issue is fixed in version 2.17.6.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"ApostropheCMS is an open-source Node.js content management system. Prior to 2.17.6, sanitizeHtml() can pass disallowed executable markup through packages/sanitize-html/index.js when textarea or xmp is included in allowedTags because a literal solidus after the raw-text end-tag name is treated as text by htmlparser2 and the ontext handler emits that content without escaping, while a browser parses the following img onerror markup as active HTML. This issue is fixed in version 2.17.6.","source":"cvelist"},{"lang":"en","text":"### Summary\nA mutation-XSS / allowedTags bypass: when `textarea` (or `xmp`) is included in `allowedTags`, an input containing a literal `</textarea/>` (a solidus right after the RCDATA end-tag name) lets non-allowed markup such as `<img src=x onerror=…>` pass through `sanitizeHtml()` **live and unescaped**, even though `img`/`onerror` are not in the allowlist. A spec-compliant browser executes the surviving handler — XSS. This is a literal-solidus variant that bypasses the two most recent fixes in this code area (CVE-2026-40186, CVE-2026-44990), both already applied in 2.17.5. The default configuration is not affected.\n\n### Details\n`sanitize-html` emits the text content of HTML raw-text elements (`textarea`, `xmp`) without escaping. Two things combine:\n- **Parser differential:** on input, htmlparser2 does NOT recognize `</textarea/>` (solidus after the RCDATA\n  end-tag name) as a close tag; it emits `</textarea/><img …>` as a single raw-text node.\n- **Unescaped passthrough:** the `ontext` handler (`index.js` ~575-583) appends `textarea`/`xmp` content with\n`result += text` (no `escapeHtml`), assuming it is \"already properly encoded\" — true for entity-decoded\n  content (what CVE-2026-40186 fixed) but false for this mis-tokenized literal close tag.\nA spec browser treats `</textarea/>` as a valid `textarea` close, so the following `<img onerror>` is parsed as a live element. The recent fixes addressed entity-encoding (CVE-2026-40186) and the `xmp` default (CVE-2026-44990); neither covers the literal-solidus mis-tokenization, so the raw passthrough still leaks.\n\n### PoC\n```js\n// npm i sanitize-html@2.17.5 parse5 && node poc.js\nconst sanitizeHtml = require('sanitize-html');\nconst input = '<textarea></textarea/><img src=x onerror=\"alert(document.domain)\">';\nconst opts  = { allowedTags: sanitizeHtml.defaults.allowedTags.concat(['textarea']) };  // img NOT allowed\nconsole.log(sanitizeHtml(input, opts));\n// => <textarea></textarea/><img src=x onerror=\"alert(document.domain)\"></textarea>\n//    the <img onerror> survives live and unescaped\n\nconsole.log(sanitizeHtml(input));   // default config (no textarea allowed) => \"\"  (safe)\n```\nRe-parsing the sanitized OUTPUT with **parse5** (the WHATWG HTML parser browsers/jsdom use) yields a **live\n`<img src=x onerror=alert(document.domain)>`** at `body` level (it escaped the textarea RCDATA, not inert text) → the `onerror` fires in a browser. Confirmed on 2.17.5 (Node v24). A canonical `poc.js` is attached.\n<img width=\"650\" height=\"118\" alt=\"image\" src=\"https://github.com/user-attachments/assets/d63bb5b7-ba3e-4b0e-a821-86a453ea0352\" />\n\n### Impact\nCross-site scripting (CWE-79). Requires `textarea` (or `xmp`) in `allowedTags` — a benign-looking, common addition in form builders, CMS, and rich-text editors. Adding a harmless tag that then enables XSS via *non-allowed* `img`/`onerror` breaks the sanitizer's core contract; the maintainers have fixed this class before (e.g. GHSA-9mrh). An attacker who can submit content rendered through such a configuration achieves stored/reflected XSS (cookie theft, session hijack). Severity Medium (default config is safe; user interaction to view the page). **Suggested fix:** route `textarea`/`xmp` content through `escapeHtml` instead of the raw passthrough, and/or fix the htmlparser2 `</tag/>` RCDATA end-tag tokenization to match the WHATWG spec.","format":"markdown","source":"ghsa"},{"lang":"es","text":"ApostropheCMS es un sistema de gestión de contenido de código abierto basado en Node.js. Antes de la 2.17.6, sanitizeHtml() puede permitir el paso de marcado ejecutable no permitido a través de packages/sanitize-html/index.js cuando textarea o xmp están incluidos en allowedTags porque una barra sólida literal después del nombre de la etiqueta de cierre de texto sin formato es tratada como texto por htmlparser2 y el gestor ontext emite ese contenido sin escapar, mientras que un navegador analiza el siguiente marcado img onerror como HTML activo. Este problema se ha solucionado en la versión 2.17.6.","source":"nvd"}],"published":"2026-08-17T19:49:51.903Z","modified":"2026-10-23T16:10:00.313Z","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"],"affected":[{"ranges":[{"version":"< 2.17.6","status":"affected"}],"vendor":"apostrophecms","product":"apostrophe","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.17.6"}],"ecosystem":"npm","package":"sanitize-html","purl":"pkg:npm/sanitize-html","source":"ghsa"}],"references":[{"url":"https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-jxwj-j7wr-gfrw","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/apostrophecms/apostrophe/pull/5501","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/apostrophecms/apostrophe/commit/eae1fb2b72ec5d1c27d0977509c6482a0408f725","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63670","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/apostrophecms/apostrophe","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-08-18T18:07:52.564Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-63670","url":"https://www.cve.org/CVERecord?id=CVE-2026-63670","licence":"CVE Terms of Use","modified":"2026-08-18T18:08:30.331Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jxwj-j7wr-gfrw","url":"https://github.com/advisories/GHSA-jxwj-j7wr-gfrw","licence":"CC-BY-4.0","modified":"2026-09-03T20:15:05.883Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-63670","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63670","licence":"Public domain","modified":"2026-10-23T16:10:00.313Z"}],"updatedAt":"2026-11-25T22:59:33.383Z","epss":{"score":0.00289,"percentile":0.23099,"date":"2026-12-01T12:00:22.000Z"}}