Stored XSS in sanitize-html Defaults via Disallowed `xmp` Tag Bypass
Vulnerability Disclosure · 3 sources · Updated 5mo ago · First seen Jun 12, 2026

A vulnerability tracked as CVE-2026-44990 allows stored cross-site scripting in sanitize-html when applications use the library’s default configuration and later render sanitized user content as trusted HTML. The flaw affects versions prior to 2.17.4 and stems from the handling of the disallowed xmp element: because htmlparser2 treats xmp as a raw-text tag, attacker-supplied markup inside it is preserved as text during sanitization but can be emitted back as active HTML or JavaScript under the default disallowedTagsMode: 'discard' behavior.
GitHub’s advisory and the upstream patch say the bypass can let payloads such as <script>, img event handlers, and svg-embedded script content survive filtering and execute in a victim’s browser. The fix in 2.17.4 adds xmp to nonTextTags so content inside a disallowed xmp tag is dropped instead of re-emitted, and regression tests were added to confirm the malicious content is removed. The issue was reported by Vincenzo Turturro (sushi-gif), and users of affected sanitize-html deployments, including those in ApostropheCMS, were urged to update immediately.


