Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted HTML to sanitizer endpoint
-
DeliveryEmbed math/annotation-xml namespace-transition payload
-
ExploitSanitizer validates descendant under MathML namespace
-
ExecutionVictim browser reparses output as HTML
-
ImpactAttacker JavaScript executes in victim session
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires an application that has explicitly built a non-default ammonia allowlist enabling ALL of: the <math> tag, the <annotation-xml> tag, and at least one raw-text HTML element (e.g. <xmp>, <noembed>, <noframes>, <style>, <script>-class raw-text parsing), while NOT allowing the 'encoding' attribute on annotation-xml. Under that configuration, ammonia strips the encoding attribute during attribute filtering but fails to re-evaluate annotation-xml's encoding-dependent MathML HTML-integration-point status, so it validates a descendant under one namespace while the browser reparses under another, enabling the namespace transition. Additional conditions: a victim must subsequently render the sanitized output in a browser that applies MathML integration-point reparsing. Key LIMITING factors: the required tags are disabled by default, so applications on stock configuration are NOT affected; exploitation is impossible without the specific permissive allowlist, and impact is limited to client-side script execution (no server-side compromise). |
| Impact | This is a genuine but config-gated vulnerability, not a broad emergency. The vendor CVSS 4.0 vector (CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N, base 6.3/Medium) is internally consistent with the description: network reachable, no privileges, but AT:P (Attack Requirements Present) correctly encodes that exploitation depends on a specific non-default sanitizer configuration, and the impact is confined to subsequent systems (SC:L/SI:L) - i.e. the victim's browser/other users via XSS, with no impact to the ammonia process itself (VC/VI/VA:N). No EPSS score was provided in the input, so probabilistic exploitation likelihood is UNKNOWN. The CVE is NOT listed in CISA KEV in the provided data, so there is no evidence of active in-the-wild exploitation. However, publicly available exploit material does exist: a dedicated researcher writeup (ivan09999.github.io/ammonia-mxss) and a working mXSS payload embedded in the upstream regression test (ns_mathml_3). No SSVC decision record was supplied. The decisive risk driver is the AT:P / configuration precondition - the required tags (math, annotation-xml, a raw-text element) are explicitly NOT enabled by default, so the realistic exposed population is the subset of ammonia users who hand-crafted an allowlist that enables exactly these elements while disabling the encoding attribute. For that narrow population the impact is real stored/mutation XSS; for everyone on defaults, risk is effectively nil. Net: a Medium-severity, low-exploitation-breadth issue that is a priority only for applications with this specific permissive MathML configuration. |
| Exploit ScenarioDerived | An application uses ammonia with a custom allowlist permitting <math>, <annotation-xml>, and a raw-text element (e.g. <xmp>) but not the encoding attribute, to sanitize user-submitted HTML (a comment, message, or profile field). An attacker submits crafted HTML that is valid under ammonia's MathML namespace interpretation but reparses under HTML rules in the browser after the encoding attribute is stripped, smuggling an <img onerror=...> past the filter. A working payload is publicly documented in the researcher writeup and the upstream regression test, so weaponization effort is minimal once the vulnerable configuration is present. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 15, 2026
Mutation cross-site scripting in the ammonia Rust HTML sanitizer (versions prior to 3.3.2, 4.0.2, and 4.1.3) allows a remote, unauthenticated attacker to execute JavaScript in a victim's browser when the victim renders sanitized output. The flaw is config-gated: it only triggers for applications that explicitly enable the math tag, the annotation-xml tag, and at least one raw-text HTML element (such as xmp) while disallowing the encoding attribute, which is a non-default allowlist - stock ammonia configurations are not affected. ammonia's own advisory confirms the issue and vendor fixes ship in 3.3.2, 4.0.2, and 4.1.3; there is no confirmed active exploitation (not in CISA KEV) and no public exploit code identified at time of analysis in the supplied intelligence, though a public technical writeup of the mutation technique is referenced.
RemediationAI
Upgrade ammonia to 3.3.2, 4.0.2, or 4.1.3 (choose the release line matching your current major version) - these are the vendor-released patched versions per GHSA-9jh8-v38h-cvhr, RUSTSEC-2026-0193, and the v3.3.2/v4.0.2/v4.1.3 release tags. If immediate upgrade is not possible, the most direct compensating control is to stop allowing the annotation-xml tag in your ammonia Builder allowlist (drop it from add_tags), which removes the namespace-transition primitive entirely at the cost of losing MathML annotation content - acceptable if you do not rely on MathML annotations. An alternative narrow workaround is to explicitly allow only the safe encoding values via add_tag_attribute_values("annotation-xml", "encoding", ["text/html"]) so the element retains a well-defined integration-point state that matches how browsers reparse it; this preserves annotation-xml but constrains its encoding to text/html and must be verified against your rendering targets. A third option is to remove raw-text HTML elements such as xmp, noembed, noframes, and style from the allowlist, which breaks the payload execution path but may reduce rendering fidelity for content that legitimately uses those tags. Because exploitation requires a downstream victim to render the sanitized output in a browser, any additional output-side defense (strict Content-Security-Policy with script-src restrictions, or sanitizing again at the rendering boundary) reduces residual risk, though it does not substitute for the patched crate.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in cargo
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
ammonia is a Rust library for cleaning untrusted HTML, built on the html5ever/html5gum parsing stack; it works by parsing input into a DOM, filtering nodes against an allowlist, and serializing the result. CVE-2026-63430 is a CWE-79 (Improper Neutralization of Input During Web Page Generation, specifically mutation XSS) rooted in how ammonia models MathML namespace transitions. Per the HTML parsing specification, an <annotation-xml> element is an HTML integration point only when its encoding attribute is exactly 'text/html' or 'application/xhtml+xml'; otherwise its children are treated as being in the SVG/foreign-content namespace. In the vulnerable flow, ammonia removed the disallowed encoding attribute during attribute filtering but did not subsequently re-evaluate whether the parent remained an integration point, so descendants were validated under one namespace interpretation (as HTML) while the browser reparsed the serialized output under another (as foreign content) - the classic mXSS namespace-transition primitive. Combined with an allowed raw-text HTML element, the mismatched reparse allows a crafted payload to break out of a raw-text context and inject an executable element or attribute. The upstream fix (PRs 243/244/245 and commits 004bf2ce, 7ac3fd31, b51bf4f9) reorders attribute adjustment relative to child cleaning and rewrites the integration-point check to explicitly test parent encoding attributes, requiring exactly one encoding attribute whose value is text/html or application/xhtml+xml, and otherwise permitting only an svg child in the SVG namespace. Unit tests added in the patch capture payloads such as '<math><annotation-xml encoding="text/html"><xmp><!--</xmp><img title="--><img src=1 onerror=alert(1)>">'. The upstream project also dropped Rust 1.60 from its CI matrix as part of the change.
Know when Ammonia gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
AC:H because exploitation needs a specific non-default allowlist plus the namespace-reparse trick; PR:N as attacker only supplies untrusted HTML; UI:R and S:C as a victim's browser executes cross-context script.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
ammonia is a Rust library for repairing and securing untrusted HTML. Prior to 3.3.2, 4.0.2, and 4.1.3, applications that explicitly allow the math tag, annotation-xml, and at least one raw-text HTML element while disallowing the encoding attribute can permit mutation cross-site scripting. ammonia does not correctly implement annotation-xml's encoding-dependent MathML integration-point behavior after attribute filtering removes encoding, so the sanitizer validates a descendant under one namespace interpretation while the browser reparses the output under another. An attacker can use that namespace transition and an allowed raw-text HTML element to execute JavaScript when a user renders the sanitized output. The required tags are not enabled by default, so applications that do not explicitly allow them are not affected. This issue is fixed in versions 3.3.2, 4.0.2, and 4.1.3.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
An issue was discovered in the ammonia crate before 3.1.0 for Rust. Rated medium severity (CVSS 6.1), this vulnerability
An issue was discovered in the ammonia crate before 2.1.0 for Rust. Rated high severity (CVSS 7.5), this vulnerability i
EUVD-2026-102241
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB