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-113650 Overview
CVE-2026-113650 is an uncontrolled recursion vulnerability in the sanitize-html package version 2.18.0, as used by ApostropheCMS. When an <iframe> tag is disallowed and disallowedTagsMode is set to discard (the default configuration), the raw-text content of the iframe is re-sanitized through a recursive call to sanitizeHtml(text, options). The recursion has no depth bound and each nested call starts with a fresh state. An unauthenticated remote attacker can submit crafted nested input to exhaust stack memory and crash the Node.js process. The issue is fixed in sanitize-html 2.18.1 and is tracked under [CWE-674].
Critical Impact
Remote, unauthenticated attackers can trigger stack exhaustion in the Node.js process, resulting in a denial-of-service condition against ApostropheCMS deployments.
Affected Products
- ApostropheCMS using sanitize-html 2.18.0
- sanitize-html 2.18.0 (fixed in 2.18.1)
- Any Node.js application bundling the vulnerable sanitize-html 2.18.0 release
Discovery Timeline
- 2026-10-20 - CVE-2026-113650 published to NVD
- 2026-10-20 - Last updated in NVD database
Technical Details for CVE-2026-113650
Vulnerability Analysis
The flaw sits in the HTML sanitization path used by ApostropheCMS to strip disallowed markup from user-submitted content. When the sanitizer encounters an <iframe> tag and <iframe> is not in the allow-list, the default disallowedTagsMode: 'discard' behavior removes the tag but treats the inner content as text that must itself be re-sanitized. The sanitizer accomplishes this by invoking sanitizeHtml(text, options) recursively.
Because each recursive invocation initializes a fresh parser state, nested disallowed structures are not detected as repeated work and no counter tracks recursion depth. Deeply nested or self-referential input therefore drives the call stack toward exhaustion. Node.js responds with a RangeError: Maximum call stack size exceeded, terminating the request handler and, in many deployments, the worker process. The result is a network-reachable denial of service against the content endpoints that invoke the sanitizer.
Root Cause
The root cause is unbounded recursion in sanitize-html 2.18.0 [CWE-674]. The function recursively re-sanitizes the raw-text payload of discarded <iframe> elements without enforcing a maximum recursion depth or iterative traversal strategy.
Attack Vector
Exploitation requires only network access to an endpoint that forwards user input through sanitize-html with default settings. No authentication or user interaction is required. An attacker submits a payload containing deeply nested <iframe> structures to any field that is sanitized server-side, such as rich-text areas or comment inputs. The sanitizer recurses into the discarded content until the stack is exhausted. See the ApostropheCMS security advisory GHSA-c9rx-x947-fp3h for additional context.
No public proof-of-concept exploit code was referenced in the advisory, so no synthetic exploit is reproduced here.
Detection Methods for CVE-2026-113650
Indicators of Compromise
- Repeated RangeError: Maximum call stack size exceeded errors originating in sanitize-html stack traces within Node.js logs.
- Unexpected worker restarts or process crashes correlated with POST requests to content-submission endpoints.
- Inbound requests whose bodies contain large numbers of nested <iframe> tags or oversized HTML payloads targeting rich-text fields.
Detection Strategies
- Inventory Node.js dependencies with npm ls sanitize-html and flag any resolution to version 2.18.0.
- Add web application firewall rules that inspect request bodies for abnormal nesting depth of <iframe> or other HTML tags.
- Alert on Node.js process restarts and uncaught RangeError exceptions emitted by the sanitizer.
Monitoring Recommendations
- Track CPU and memory spikes on application servers servicing content-authoring endpoints.
- Log and sample request payload sizes on routes that invoke sanitize-html to baseline normal input shape.
- Correlate HTTP 5xx responses from ApostropheCMS endpoints with sanitizer stack traces in centralized logging.
How to Mitigate CVE-2026-113650
Immediate Actions Required
- Upgrade sanitize-html to version 2.18.1 or later across all Node.js services, including transitive dependencies.
- Update ApostropheCMS to a release that pins the patched sanitize-html version, as published in the sanitize-html 2.18.1 release.
- Restrict unauthenticated access to content-submission endpoints while the patch is being rolled out.
Patch Information
The fix is delivered in sanitize-html 2.18.1. Relevant changes landed in the ApostropheCMS repository under commits 06e4b377 and 40b989b1. Review the GHSA-c9rx-x947-fp3h advisory for the authoritative fix guidance.
Workarounds
- Add iframe to allowedTags or set disallowedTagsMode to a non-recursive mode such as escape to avoid the recursive sanitization path.
- Enforce a maximum request body size and reject payloads containing excessive HTML tag nesting at the reverse proxy or WAF layer.
- Run sanitization in a worker thread or child process with resource limits so that stack exhaustion does not crash the primary application process.
# Configuration example: upgrade to the patched release
npm install sanitize-html@2.18.1
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

