DOMPurify mXSS and Ivanti EPMM KEV boundary guidance¶
Signal: The 2026-05-07 hourly scan found two durable defensive items: GitHub Security Advisories REST fallback published DOMPurify mutation-XSS via re-contextualization (GHSA-h8r8-wccr-v5f2), and CISA KEV added actively exploited Ivanti Endpoint Manager Mobile (EPMM) improper input validation RCE (CVE-2026-6973) with a 2026-05-10 due date.
Advisories covered¶
- DOMPurify mutation-XSS via re-contextualization, GHSA-h8r8-wccr-v5f2: sanitized HTML can become executable when an application takes DOMPurify output, wraps it in special parsing contexts such as
script,xmp,iframe,noembed,noframes, ornoscript, and reparses it withinnerHTML. The advisory describes attacker-controlled closing sequences mutating into event-handler markup during the second parse. - Ivanti EPMM improper input validation RCE in KEV, CVE-2026-6973: CISA says remotely authenticated administrative users can achieve remote code execution in Ivanti Endpoint Manager Mobile. Federal due date is 2026-05-10; all exposed or internet-reachable EPMM deployments should treat this as urgent because KEV means exploitation is already observed.
Why this is durable¶
Both items are boundary failures after an apparent safety check. DOMPurify may correctly sanitize the first parse tree, but the application changes the browser parsing context afterward. Ivanti EPMM administrative interfaces sit at a device-management control plane where an input-validation bug becomes remote code execution with fleet-level impact. The reusable lesson: validation must be tied to the final sink and privilege boundary, not to an earlier intermediate representation.
Immediate triage¶
- For DOMPurify users: find code that sanitizes HTML and later concatenates or wraps it before assigning to
innerHTML,outerHTML, template HTML, rich-text previews, iframe bodies, or server-rendered hydration islands. - Block or refactor patterns that place sanitized user-controlled content inside
script,xmp,iframe,noembed,noframes,noscript, SVG/MathML, or other context-changing wrappers. Prefer DOM node construction and text nodes for wrapper content. - Add regression tests for payloads containing closing wrapper sequences inside attributes, then render through the exact production sink rather than only testing the sanitizer return value.
- For Ivanti EPMM: identify every EPMM instance, especially internet-facing admin or management portals. Apply Ivanti mitigations/patches, or isolate/discontinue the product if mitigations are unavailable.
- Because the KEV entry allows authenticated admin RCE, review admin account history, recent configuration changes, uploaded packages/profiles, command execution artifacts, and outbound connections from EPMM hosts before and after remediation.
Hunt prompts¶
DOMPurify.sanitize(...)followed by string concatenation, template interpolation, wrapper tags, or a later.innerHTML =assignment.- Sanitized rich-text values stored in databases and re-rendered later into a different component, editor preview, email template, or embed wrapper.
- Client-side alerts, CSP violations, unexpected event-handler attributes, or reports that only trigger after content is saved and viewed in another page.
- Ivanti EPMM admin logins from unusual IPs, new administrative users, unexpected device-management policies, package/profile uploads, task execution, or shell/process activity on the management server.
- EPMM egress to unfamiliar infrastructure, webshell-like files, modified scheduled jobs/services, or log gaps around the exploitation window.
Durable controls¶
- Treat sanitizer output as safe only for the sink and parsing context it was validated for. If the context changes, re-encode or rebuild through safe DOM APIs.
- Keep dangerous wrapper contexts out of user-content rendering paths; if a wrapper is unavoidable, insert untrusted content as text, not HTML.
- Pair HTML sanitization with strict CSP, Trusted Types where supported, and sink-level tests that cover browser mutation behavior.
- Place device-management control planes behind VPN/zero-trust access, phishing-resistant MFA, admin allowlists, and strong logging; do not expose EPMM admin surfaces directly to the internet.
- For KEV-class management-plane RCE, patching is not the finish line: preserve evidence, rotate credentials/tokens reachable from the server, verify integrity, and rebuild from known-good images if compromise indicators appear.
October 22 follow-up: ammonia, the sanitizer strips an attribute, and the attribute was holding the child in a parsing context (CVE-2026-63430 / GHSA-9jh8-v38h-cvhr, ammonia < 3.3.2 / 4.x < 4.0.2 / 4.1.x < 4.1.3, writeup)¶
The Rust-side member of this page's mXSS family, and the cleanest statement of the mechanism yet. ammonia's annotation-xml handling: the namespace filter runs on the input DOM, where <math><annotation-xml encoding="text/html"><gadget></annotation-xml></math> parses children as HTML and passes tag allowlists; the attribute filter then strips encoding because it isn't allowlisted. Post-sanitize, the browser re-parses the output with annotation-xml as a plain MathML element, children re-enter MathML parsing, and a gadget crafted to mean different things in HTML vs MathML context executes.
The generalization: a sanitizer's attribute allowlist must be checked against the HTML parsing algorithm, not just against XSS. Some attributes are parsing-context carriers, encoding on annotation-xml, srcdoc on iframe, type on <script>/<template>, sandbox, and stripping them silently changes how everything downstream re-parses. Validation happened on one context; the browser honors another. This is the same defect shape as the SmarterMail iCal MathML foreign-content leg (Oct 9 page) and the ApostropheCMS isImplied-close discard escape (Oct 20 page): the sanitizer's internal DOM model and the browser's tokenizer disagree after sanitizer mutation.
Operator battery for any product with a Rust (ammonia), JS (DOMPurify/sanitize-html/custom), or Go (bluemonday) sanitizer in front of user HTML:
- Enumerate the enabled tag set from public render output, then test the integration-point matrix:
math,svg,foreignObject,annotation-xml,desc,title×encoding="text/html"andtext/html+templatevariants, each present / garbled / absent. The absent leg is the sanitizer's own mutation, compare browser-parsed DOM before and after sanitize for the same input; a diff in child-element namespaces is the finding. - Raw-text-element dependency check. The ammonia gadget required one raw-text HTML element to survive the allowlist (
title,textarea,xmp,iframe,noembed,noframes,plaintext,noscript,style,script). If a product enables any of these and MathML/SVG, it is in the vulnerable configuration; if it enables neither, the class is closed there, fingerprint the config from outside before spending time on the class. - Attribute-strip differential: for every allowlisted structural tag, sanitize a version of the payload with each non-allowlisted attribute attached and check whether stripping that attribute changes child parsing (context-carrying attribute grep against the HTML spec's conditionally-including-integration-points table).
- Fingerprint: ammonia fix commits
004bf2c/7ac3fd3/b51bf4fship 3.3.2/4.0.2/4.1.3; Rust services exposing user-rendered HTML (many use ammonia precisely because it "is DOM-based") are the target set, and the advisory's own impact note (requires MathML + a raw-text tag) means most deployments are not affected, prove the config first.
October 27 follow-up: SVGO removeScripts, the optimizer-as-sanitizer, namespace prefixes, tab-in-scheme, and the foreignObject HTML island (CVE-2026-84370 / GHSA-w27v-7q3p-w38r, high 8.2, svgo npm ≥1.0.0 <2.8.4 / ≥3.0.0 <3.3.5 / ≥4.0.0 <4.1.0, fix diff)¶
SVGO is an SVG optimizer, but its opt-in removeScripts/removeScriptElement plugin is what many products actually rely on as their SVG sanitizer for user-uploaded SVG served in an active same-origin context. Two bypasses shipped in every maintained line (v1 is EOL and was never fixed):
- Namespace-prefixed executable elements missed. The plugin matched unprefixed
<a>/<script>but not prefix-bound forms like<svg:a>when the prefix is bound to the SVG namespace; the anchor's executablehref(and namespaced*:href) survived untouched. The fix made every executable-element check namespace-aware and case-folded (DATA:...also survives pre-fix scheme checks). - ASCII tab/LF/CR embedded in the scheme. Browsers remove ASCII tabs and newlines from URLs before parsing the scheme, so
java	script:evaded the plugin's literaljavascript:string match and stayed executable after "sanitization." This is the exact normalization-differential family as Joomla's whitespace-in-data:-URI InputFilter bypass and Payload'sgetSafeRedirecttab/CR/LF leg, deny-list matchers see un-normalized input; the browser parses post-normalization.
The fix diff itself leaks two more axes that were silent pre-fix (treat as unknown-state until you test both):
foreignObjectis an HTML island the SVG grammar never covered. Pre-fix,removeScriptsonly removed<script>elements inside<foreignObject>subtrees, it never touched HTMLon*event attributes (including HTML-only names likeonbeforetogglethat aren't in the SVG event-attribute sets),iframe srcdoc, oraction/form/formaction/href/src/datacarryingjavascript:/vbscript:/executabledata:URLs. The browser re-enters HTML parsing insideforeignObject, so an SVG sanitizer whose grammar stops at SVG scope has an uncovered language in its own output. Same "sanitization context ≠ final parse context" thesis as the ammonia leg above, expressed as a subtree instead of an attribute.- Executable
data:media types. A blanketdata:allow (or ajavascript:-only deny) missesdata:text/html,data:image/svg+xml, anddata:application/xhtml+xmlas document carriers whiledata:image/pngstays inert. The fix's own test fixture is a ready-made probe matrix: HTML/XHTML/SVG data-URLs stripped, PNG data-URL preserved.
Operator battery for any product that "sanitizes" SVG with an optimizer/parser (SVGO, svgo-cli in upload pipelines, image CDNs, avatar processors):
- Fingerprint the pipeline first: SVGO output is recognizable (collapsed attributes, removed comments/whitespace,
viewBoxre-serialization). Grep-equivalent from outside: does the served SVG differ from input only by optimization signatures? - Prefix battery: attach an
xmlns:-bound prefix to every element/attribute the sanitizer is supposed to neutralize (<svg:a href=…>,svg:script, prefixed*:href) and diff what disappears vs plain spelling. Divergent treatment of prefix-bound vs unprefixed = namespace-blind matcher. Also test case-folded schemes (DATA:,JavaScript:). - Whitespace-in-scheme battery:
java	script:,java\tscript:,java\nscript:, leading-whitespace, and combinations with the prefix battery, against every URL attribute the sink preserves. - foreignObject battery: inside
<foreignObject>, submit<div onbeforetoggle=…>,<iframe srcdoc=…>,<form action=javascript:…>,<button formaction=…>,<object data=data:text/html,…>, event attrs, srcdoc, and HTML URL attrs all pre-auth to the plugin's original scope. - Proof boundary: harmless DOM markers (
alert(1)-free, e.g.document.titlewrites or an owned callback beacon) in your own SVG canary, served through the product's real sink; never leave stored payloads. Fingerprint bands: fixed 2.8.4 / 3.3.5 / 4.1.0; anything older enablingremoveScriptsas sole protection is in scope, and v1 installs are unfixable-by-patch.
November 12 follow-up: Loofah six-leg wave, the Ruby sanitizer family (attribute-escape mXSS, / named-reference URI differential, escaped-paren CSS url() re-parse) (CVE-2026-126203/126206/126207/126205/126209/126208 / GHSA-h6v6-rg66-fqj4, GHSA-jcff-cj73-4w4f, GHSA-m3x9-938q-5767, GHSA-mf2j-8f84-cc9q, GHSA-p9wj-w8xq-vjx6, GHSA-345x-3rq2-jfrm, loofah < 2.25.3, published 2026-11-12 20:52-21:26Z)¶
A coordinated six-advisory wave against Loofah (the Ruby HTML sanitizer under Rails-adjacent rich-text stacks, fixed 2.25.3, mXSS leg requires Nokogiri >= 1.19.5) re-states this page's thesis in three new dialects: the sanitizer and the browser disagree about decoding, in attributes, in URIs, and in CSS. (Second wave after the scan boundary added the semicolon-less-numeric-ref and SVG-safelist-case legs, items 5-6.)
- Unescaped
</>in attribute values plus MathML = mXSS out of the default allowlist (GHSA-h6v6-rg66-fqj4, Nokogiri < 1.19.5): the HTML5 scrubbers emitted attribute values without escaping angle brackets (the HTML standard requires it), so markup placed inside an allowed attribute on MathML content re-parses as live HTML in the viewer's browser. Scope asymmetry is the hunt tell::stripaffected in every browser,:prune/:escapeonly in WebKit. Not affected: the HTML4 API (Loofah::Helpers.sanitize),:whitewash, rails-html-sanitizer defaults, JRuby. Same final-parse-context family as the ammoniaannotation-xmlleg (a MathML/foreign-content re-parse context the serializer never accounts for). Operator rule: serialize-to-parse differential test - take the sanitizer's output string, not its in-memory tree, and render it through the real sink per browser engine; strip/prune/escape are three different products, test each scrubber mode the app actually uses. data:text/htmlpassesallowed_uri?because the sanitizer decodes numeric refs but not HTML5 named refs (GHSA-jcff-cj73-4w4f):allowed_uri?normalizes withCGI.unescapeHTML, which handles numeric character references but not the HTML5 named table./survives normalization, the mediatype has no/, fails MIME grammar, and falls back to the allowedtext/plainunder the WHATWG malformed-mediatype rule; the browser decodes/and executes it astext/html. The advisory closes the attack alphabet for you::,/,	,
are the only named refs that change URI parsing (no ref exists for CR). Trigger condition: the app must call the string-levelallowed_uri?(or theRails::HTML::Sanitizer.allowed_uri?re-export) on HTML-encoded input; the defaultsanitize()path decodes during parse first, so it is not affected. Operator rule: named-character-reference battery on every string-level URL validator -data:text/html,java
script:,	javascript:, against validators that do their own entity decoding; check whether the validator's decoder table matches the sink's (numeric-only vs full HTML5 named table is a decoder-parity diff, same shape as the SVGO tab-in-scheme leg).- CSS
url()hidden from the deny-list by escaped parens, then resurrected by the rebuild (GHSA-m3x9-938q-5767):scrub_csstokenizedstyleonce and rejected top-level:url/:bad_urltokens only against that first parse; when it rebuilt each property it emitted identifiers with CSS escapes decoded, sourl\28 …\29hid the token from the check and the rebuilt value re-parsed into a liveurl()nothing re-checked. Escaped property names, six-digit escapes, escaped comments, and escaped quotes reached the same place. Impact ceiling matters for reporting: no script survives;list-stylefetches on render andcursoron hover leak viewer IP/UA/timing and reach viewer-network-only hosts - report as SSRF-flavored data leak, not XSS. Operator rules: (a) validate-once, re-parse-unverified is a sanitizer-generic bug - if the tool tokenizes, filters, then re-serializes with different escape semantics, re-run the whole deny-list against the output by submitting output-shaped input; (b) the CSS escape battery (\28,\29,\3a, six-digit, escaped/*, escaped quotes) belongs in every rich-textstyle/SVG-attribute fuzzer. -
Tracked note (DoS, no publish-worthy sink): SVG local-reference regex
/^\s*[^#\s].*/mis quadratic on all-whitespacehrefunder Ruby <= 3.1 (^anchors per line,\smatches newline; Ruby 3.2's linear-time engine masks it). Reusable micro-lesson: Ruby regex semantics differ from other languages in sanitizers -^/$are line anchors unless you meant\A/\z, and a sanitizer written by someone assuming Python/JS semantics is both a bypass candidate and a cheap CPU-amplification oracle; probe path-like and href-like validator fields with multi-line whitespace payloads and time the response. -
Wave extension (two more legs 21:26Z): semicolon-less numeric refs eaten by the strip-before-decode order (GHSA-p9wj-w8xq-vjx6, CVE-2026-126209):
allowed_uri?strips control characters and whitespace before decoding numeric character references. A browser ends a semicolon-less reference at the following space/tab; deleting that terminator lets the reference run on into the following text, sojavascript: alert(1)decodesΪ(U+03AA) instead of a colon, no scheme is detected, and the helper returns safe, while the browser terminates the ref at the character the sanitizer removed and executesjavascript: alert(1). Decimal refs and refs encoding a scheme letter (j\tavascript:) behave identically. Same trigger condition as the/leg: only callers of the string-levelallowed_uri?(or theRails::HTML::Sanitizer.allowed_uri?re-export) on HTML-encoded input; the defaultsanitize()path decodes during parse. Operator rule: decoder parity has an ordering axis, not just a table axis. For any validator that does its own normalization, enumerate the strip/decode/trim order and probe strippable-terminator shapes: numeric refs without;followed by each character the validator deletes.:<space>,:<tab>,j<tab>avascript:belong next to the named-ref battery. - Safelist case mismatch:
textPathlisted lowercase,mpathmissing entirely, Firefox fetches the escape (GHSA-345x-3rq2-jfrm, CVE-2026-126208, all loofah < 2.25.3): the local-reference restriction consultsSVG_ALLOW_LOCAL_HREF, which listedtextpathin lowercase while the HTML5 parser names the elementtextPathinside<svg>, so the check never matched on the HTML5 path;mpathwas absent from the list on both paths. An externalhref/xlink:hrefon either element survives sanitization, and Firefox fetches it at render, leaking viewer IP/UA/referrer and reaching hosts routable only from the viewer's network; Chrome and WebKit do not fetch.rails-html-sanitizer'sPermitScrubberreuses the same safelist. Operator rules: (a) safelist-membership audit against the parser's canonical element names, case included: any allow/deny list matched case-sensitively against markup whose canonical name has mixed case (HTML5 foreign-content element table:textPath,feGaussianBlur,clipPath,linearGradient) is a silent-miss candidate; diff the list against the spec camelCase table, not against your own notes. (b) Cross-engine fetch asymmetry again bounds the report: Firefox-only beaconing = data-leak framing with an IP/UA/referrer canary, not XSS.
Validation boundary: disposable Rails/RichText app or plain Loofah harness with your own canary HTML; render output through a real browser engine you control, beacon to an owned callback for the CSS url() leg; never store payloads on third-party targets. Bands: loofah >= 2.25.3 + Nokogiri >= 1.19.5 close the set; HTML4-API-only apps and rails-html-sanitizer defaults are out of scope for the mXSS leg (confirm which API the app actually calls before filing).
November 13 follow-up: rails-html-sanitizer shares one mutable scrubber across threads, a permissive sanitize call in flight can launder your payload through a stricter call's allowlist (GHSA-h7wh-q2qr-458c / CVE-2026-128069, rails-html-sanitizer < 1.7.2)¶
The day after the Loofah wave, its Rails wrapper fell on a different axis: not sanitizer-vs-browser disagreement, but sanitizer-vs-itself under concurrency. Rails::HTML::SafeListSanitizer (HTML4 and HTML5 variants) keeps one PermitScrubber instance per sanitizer instance and assigns tags/attributes on it at the start of every sanitize call with no synchronization. Action View memoizes a single SafeListSanitizer per helper module for the whole process, so under Puma every request shares that scrubber. If any code path in the app ever calls sanitize with a more permissive tags:/attributes: list (including the default call, which differs from any custom call), an attacker who fires input at the permissive path concurrently with a strict-call request gets their markup scrubbed against the wrong allowlist: script tags or on* attributes admitted by the permissive config emit unchanged into the strict call's stored/rendered output. Stored XSS with no flaw in either allowlist itself.
Trigger conditions to fingerprint before reporting (all must hold): multi-threaded server (Puma threads > 1, JRuby; single-threaded and per-request-sanitizer apps are out), and at least two distinct sanitize option sets in the codebase (one custom-allowlist call site vs bare sanitize, or two different custom lists), and a user-controlled sink on the stricter path. The race window is the whole duration of the permissive call, so sustained concurrent load on both routes is the practical proof technique, not a single-shot.
Operator rules:
- Shared-mutable-config race is a sanitizer-generic class. Any time a security component caches a configured instance (scrubber, policy object, parser settings) and mutates it per call, concurrent calls with different configs bleed policy across each other. Audit shapes: singleton sanitizer + per-call option arguments;
attr_accessorconfig on a memoized helper; process-global toggle (the DOMPurify mutable-CONFIGand marked-prototype-pollution legs are the JS twins of this bug). - Two-sink differential probe for Rails targets: find every
sanitizecall site (source grep if you have repo access, behaviorally: params that strip tags in one feature but preserveimg/iframe/style in another), then replay the permissive feature's accepted markup shapes against the strict feature under concurrent load from a second session. The tell is markup that never survives a lone strict call appearing in stored output while the permissive route is hammered. - Report shape: name the two call sites whose configs cross, the exact tags/attrs that leaked from which allowlist, and the thread-count precondition. Fixed in 1.7.2 (per-call scrubber); the vendor workaround (pass your own
scrubber:per call) is also a fingerprint of an unpatched-but-hardened app. Same-wave tracked no-publish: GHSA-cpgf-5mjf-73p7 trails-html-sanitizer config-dependent ReDoS (availability-only).
November 27 follow-up: DOMPurify depth check bypassed by special nesting plus prototype pollution weakening the depth check itself (GHSA-mmhx-hmjr-r674, fixed by commits 1e520262 (3.x) / 26e1d69c (2.x))¶
A fresh DOMPurify bypass landed in the 15:31Z wave with a two-axis composition worth noting even though the advisory text is thin: malicious HTML using special nesting techniques evades the depth checking added in recent releases, and separately prototype pollution can be used to weaken the depth check. The XSS that the depth limit exists to stop (polyglot deep-nesting parser-differential payloads of the mXSS family this page tracks) becomes reachable again by (a) finding a nesting shape the depth counter miscounts and/or (b) polluting the object that holds the counter's configuration.
Operator rules:
- Mitigation-mechanism bypass is its own test class, distinct from payload bypass. The depth limit was added as the fix for deep-nesting issues; the new bypass attacks the mitigation's implementation (counter logic + its config surface), not a new sink. When a sanitizer changelog announces a new guard, attack the guard first: which counter, what increments it, where does its threshold live, and is that storage reachable by prototype pollution or shared-state mutation (the CONFIG leg earlier on this page, the marked prototype-pollution lineage, the rails-html-sanitizer shared-scrubber leg are all this same attack on shared sanitizer state).
- Prototype pollution is a sanitizer-policy control-plane. Any JS sanitizer whose options live on reachable objects (config objects, allowed-tags sets read via prototype chain, depth/limit numbers) inherits every pollution gadget the host page permits. Battery: pollute the obvious config keys (
ALLOWED_TAGS,sanitizeoptions, numeric limits) in your own harness and re-run a previously-blocked payload; the tell is a payload blocked pre-pollution passing post-pollution from the same input. - Version-pinning matters more for sanitizers than most libraries. DOMPurify's fix ships on two branches (3.x and 2.x) with different commits; fingerprint the exact version on target pages (bundle grep for
DOMPurify.versionor the UMD banner) before pricing deep-nesting tests, and re-test every "fixed" version against the current bypass corpus, because bypasses within a patched major are routine in this component's history. - Validation boundary unchanged: your own harness with inert DOM markers, no live-page probes; for client targets, report with the exact version, nesting shape, and pollution key that flipped the decision.