Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-113654 Overview
CVE-2026-113654 is a cross-site scripting (XSS) vulnerability [CWE-79] affecting ApostropheCMS and the sanitize-html library prior to version 2.18.0. The flaw occurs when sanitize-html is configured with a non-default nonTextTags list that includes noscript. In this configuration, htmlparser2 can emit an implied ancestor close inside noscript, ending the discard region early. Scripting-enabled browsers treat noscript content as raw text, while the parser does not model that mode. As a result, content intended to remain inert can survive sanitization and render in the browser.
Critical Impact
Authenticated attackers submitting crafted HTML can bypass sanitization and achieve stored XSS, enabling script execution against users of affected ApostropheCMS sites.
Affected Products
- ApostropheCMS (Node.js content management system)
- sanitize-html versions prior to 2.18.0
- Applications using sanitize-html with a custom nonTextTags list that includes noscript
Discovery Timeline
- 2026-10-20 - CVE-2026-113654 published to NVD
- 2026-10-20 - Last updated in NVD database
Technical Details for CVE-2026-113654
Vulnerability Analysis
The vulnerability arises from a parsing-model mismatch between htmlparser2 and the HTML specification for noscript handling. sanitize-html relies on htmlparser2 events to determine when a discard region (such as the interior of a non-text tag) begins and ends. When a non-default configuration adds noscript to the nonTextTags list, the sanitizer expects everything between the opening and closing noscript tags to be discarded as raw text.
However, htmlparser2 can emit an implied ancestor close event while inside the noscript region. This premature close causes sanitize-html to exit the discard state earlier than intended. Payload content that should have been dropped is then processed as normal markup and emitted into the sanitized output. Because scripting-enabled browsers parse noscript content differently from the parser model used here, the surviving markup renders as active HTML, resulting in stored or reflected XSS.
Root Cause
The root cause is a semantic gap between the parser event stream and the browser's raw-text handling of noscript in scripting-enabled contexts. sanitize-html trusted htmlparser2's close signaling to delimit the discard region without validating that the close corresponded to the expected noscript boundary.
Attack Vector
An attacker with permission to submit HTML content, for example through a rich-text field, crafts markup that nests tags inside noscript such that htmlparser2 emits an implied ancestor close. The remaining payload escapes the discard region and is serialized into the sanitized HTML. When another user loads the page, the browser evaluates the surviving markup and executes attacker-controlled JavaScript. The issue does not generalize to every default nonTextTags element; exploitation requires the specific non-default inclusion of noscript.
See the ApostropheCMS Security Advisory GHSA-x3q4-9hxx-gx8m and the upstream fix in the sanitize-html 2.18.0 release for technical details.
Detection Methods for CVE-2026-113654
Indicators of Compromise
- Stored content fields containing <noscript> elements wrapping tags that trigger implied ancestor closes, such as block-level elements inside inline contexts.
- Unexpected <script>, onerror, or onload attributes present in rendered output that originated from user-submitted rich text.
- Audit log entries showing content submissions by low-privilege authors containing nested noscript markup.
Detection Strategies
- Inventory applications that depend on sanitize-html and review their configuration for nonTextTags entries that add noscript.
- Compare sanitized output against expected HTML schemas to flag residual scripting constructs.
- Instrument content pipelines to log and alert on sanitizer output that contains executable attributes or tags.
Monitoring Recommendations
- Monitor web application logs for POST requests to content endpoints containing noscript with nested closing tags.
- Enable Content Security Policy (CSP) reporting to capture unexpected inline script execution on content pages.
- Review browser-side runtime telemetry for script evaluation originating from CMS-rendered regions.
How to Mitigate CVE-2026-113654
Immediate Actions Required
- Upgrade sanitize-html to version 2.18.0 or later in all projects, including transitive dependencies pulled in by ApostropheCMS.
- Update ApostropheCMS to the release that pins the fixed sanitize-html version per the vendor advisory.
- Audit all sanitize-html configurations and remove noscript from custom nonTextTags lists where it is not required.
Patch Information
The issue is fixed in sanitize-html2.18.0. ApostropheCMS references the fix in commits 9500b8b and f84fd41, and in the sanitize-html 2.18.0 release notes.
Workarounds
- Remove noscript from any custom nonTextTags configuration until the upgrade is complete.
- Enforce a strict Content Security Policy that blocks inline scripts and event handler attributes on content-rendering pages.
- Restrict HTML submission to trusted roles and apply secondary server-side validation of sanitizer output.
# Upgrade sanitize-html to the fixed version
npm install sanitize-html@^2.18.0
# Verify the resolved version in the dependency tree
npm ls sanitize-html
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

