Skip to main content

ammonia CVE-2026-63430

| EUVDEUVD-2026-102241 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-10-15 GitHub_M
6.3
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted HTML to sanitizer endpoint
  2. Delivery
    Embed math/annotation-xml namespace-transition payload
  3. Exploit
    Sanitizer validates descendant under MathML namespace
  4. Execution
    Victim browser reparses output as HTML
  5. Impact
    Attacker 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

ammonia 4.1.0, < 4.1.3
ammonia < 3.3.2
ammonia 4.0.0, < 4.0.2

Affected Packages

cargo ammonia fix: 3.3.2, 4.0.2, 4.1.3

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="--&gt;&lt;img src=1 onerror=alert(1)&gt;">'. 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

Vendor (GitHub_M) PRIMARY 6.3 MEDIUM
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
vuln.today AI 4.7 MEDIUM

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.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Oct 15, 2026 - 19:18 EUVD

DescriptionCVE.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

EPSS Score
0.6%
Top 55% exploitable
Prevalence
Medium
popular Rust HTML-sanitization library; significant within Rust web ecosystem, not ubiquitous
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

33
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +32
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy