KEVWire

Security intelligence, with context.

Response snapshot Oct 26, 2026, 22:09 UTC

Back to the wire
Permalink
VulnerabilityCVE-2026-113654

ApostropheCMS sanitize-html: nonTextTags discard region ends early on an implied close, letting <noscript> content render

`sanitize-html` discards the *content* of every element in `nonTextTags`. It delimits that region using htmlparser2's close events, and ignores the `isImplied` flag htmlparser2 passes it.

At a glance

Exploited
Not known
Severity
5.3 Medium (CVSS 4.0)
Chance of exploitation
0.3% in the next 30 days
Sources
1 source

What to do

GitHub lists first patched versions: sanitize-html: 2.18.0. Confirm the affected range and upgrade guidance in the exact advisory.

Read GitHub-reviewed advisory GHSA-x3q4-9hxx-gx8m (opens a new tab)

What happened

## Summary

`sanitize-html` discards the *content* of every element in `nonTextTags`. It delimits that region using htmlparser2's close events, and ignores the `isImplied` flag htmlparser2 passes it. Closing a still-open **ancestor** from inside a ` ` makes htmlparser2 unwind its stack past the `noscript`; the synthetic implied close it emits on the way ends the discard region early, and everything after it is treated as ordinary body content.

A browser with scripting enabled parses ` ` content as **raw text**, so the same markup renders as inert text there. The sanitizer therefore emits elements the page itself would not have.

## Reproduction

Continue reading

```js const sanitizeHtml = require("sanitize-html");

sanitizeHtml('

', { allowedTags: ["div", "img"], allowedAttributes: { img: ["src"] }, nonTextTags: ["script", "style", "textarea", "option", "noscript"], }); // => '

' ```

Chrome, given the same input, renders **no** ` ` — the whole payload is raw text inside the unclosed ` `. Verified with Playwright, `srcdoc` into an iframe so the scripting flag is on.

A ` Hi

]]> Reset your password ```

htmlparser2 runs a CDATA token to `]]>`; Chrome ends a bogus comment at the first `>`, so the ` ` after it is real to the browser and invisible to the parser.

## Where the behaviour is

`index.js`:

- `:154` — `nonTextTagsArray` (the default list, `['script','style','textarea','option','xmp']`). - `:638` — `onclosetag: function (name, isImplied)` — receives the flag. - `:644` — `skipTextDepth--` — decrements without consulting `isImplied`.

## Suggested fix

Do not end a discard region on an implied close. htmlparser2 already distinguishes them; the flag is passed and discarded. Something close to:

```js onclosetag: function (name, isImplied) { if (skipText) { if (isImplied) return; // an implied close must not end the region skipTextDepth--; … ```

Affected package ranges reported by GitHub: sanitize-html: < 2.18.0

Scores and how they were measured

CVSS base severity

5.3

Version 4.0As of

CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N

Measurement source (opens a new tab)

How bad it is if exploited. Not a prediction of exploitation or proof you are exposed.

EPSS probability

0.3%

Scored Percentile 28.2%

Model and measurement source (opens a new tab)

A model's estimate of exploitation in the next 30 days, not certainty or your own risk.

Related technology

Sources

  1. Primary source

    GitHub-reviewed advisory GHSA-x3q4-9hxx-gx8m (opens a new tab)

    The public advisory supplies the description, affected package/version ranges, and any listed CVSS metric. GitHub review is not local review.

    Published Checked

  2. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-x3q4-9hxx-gx8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  3. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-x3q4-9hxx-gx8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  4. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-x3q4-9hxx-gx8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  5. Primary source

    FIRST measured EPSS score (opens a new tab)

    Measured EPSS probability and percentile for CVE-2026-113654, scored 2026-10-26. This is a model estimate, not proof of exposure.

    Published Checked

Cite this record

For factual claims, cite the primary sources above; cite KEVWire for its compilation, dates, and classifications.

APA

KEVWire. (2026, October 20). ApostropheCMS sanitize-html: nonTextTags discard region ends early on an implied close, letting <noscript> content render (CVE-2026-113654). https://kevwire.com/record/CVE-2026-113654

MLA

"ApostropheCMS sanitize-html: nonTextTags discard region ends early on an implied close, letting <noscript> content render (CVE-2026-113654)." KEVWire, 20 Oct. 2026, kevwire.com/record/CVE-2026-113654.

Chicago

KEVWire. "ApostropheCMS sanitize-html: nonTextTags discard region ends early on an implied close, letting <noscript> content render (CVE-2026-113654)." Last modified October 20, 2026. https://kevwire.com/record/CVE-2026-113654.

Evidence summary (plain text)

ApostropheCMS sanitize-html: nonTextTags discard region ends early on an implied close, letting <noscript> content render (Oct 20, 2026).
`sanitize-html` discards the *content* of every element in `nonTextTags`. It delimits that region
using htmlparser2's close events, and ignores the `isImplied` flag htmlparser2 passes it. Closing a
still-open **ancestor** from inside a ` ` makes htmlparser2 unwind its stack past the
`noscript`; the synthetic implied close it emits on the way ends the discard region early, and
everything after it is treated as ordinary body content.

A browser with scripting enabled parses ` ` content as **raw text**, so the same markup
renders as inert text there. The sanitizer therefore emits elements the page itself would not have.
CVSS 5.3 (version 4.0; evidence as of Oct 20, 2026; https://github.com/advisories/GHSA-x3q4-9hxx-gx8m).
EPSS 0.3% for the following 30 days, scored Oct 26, 2026 (https://api.first.org/data/v1/epss?cve=CVE-2026-113654&date=2026-10-26).
Sources:
GitHub-reviewed advisory GHSA-x3q4-9hxx-gx8m: https://github.com/advisories/GHSA-x3q4-9hxx-gx8m
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yMVQyMDo0NTowN1rOAAfvzQ%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yMVQyMDozMDoyNlrOAAfvxw%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yMVQyMDowMzo1N1rOAAfvxQ%3D%3D
FIRST measured EPSS score: https://api.first.org/data/v1/epss?cve=CVE-2026-113654&date=2026-10-26
Record ID: CVE-2026-113654.
Record origin: Ingested record.
AI evidence: Not assessed.
Known exploitation: Not assessed.
Zero-day status: Not assessed. KEV membership alone does not establish zero-day status.
About this data

This record was ingested from a data source. Retrieved: Oct 26, 2026, 19:40 UTC. Ingestion is not an independent editorial investigation.

A CISA KEV listing documents known exploitation, not necessarily a zero-day; absence from the catalog does not prove a vulnerability has never been exploited.

Technology tags indicate possible relevance, not verified exposure. Confirm the affected product, version, and configuration against your own inventory; KEVWire does not scan your systems.

A personal reading checklist on this device, not verified remediation.

Record JSON

Your account

Email alerts

Email alerts are not available yet. To follow your stack today, use its RSS feed, which honors your filters, or connect an AI agent through the API.

Suggest an improvement

Ideas, missing sources, corrections, and bugs are all welcome. No account needed. Suggestions are reviewed by a person before anything changes.

Record details

Record detail