CVE-2026-63430 — Vulnerability in ammonia — CVE Details
ammonia: mXSS via MathML `annotation-xml` encoding strip
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.74%). Schedule for your next planned update.
Does your project use an affected ammonia version?
Paste your Cargo.lock to check it for CVE-2026-63430 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
If a certain set of MathML tags are enabled, an attacker can inject arbitrary JavaScript code into the user's browser.
The annotation-xml tag has slightly different behavior than the other "integration point"
tags in MathML and SVG, but ammonia didn't handle it, so it didn't correctly
strip the namespace-incompatible tags.
This vulnerability only has an effect when the math and annotation-xml tags
are both enabled, but the encoding attribute is disabled, because it relies
on the following sequence of steps:
- User writes code like
<math><annotation-xml encoding="text/html"><gadget></annotation-xml></math>. - Namespace filtering checks the DOM, and it passes.
<gadget>is parsed as HTML. - Attribute filter strips it down to
<math><annotation-xml><gadget></annotation-xml></math>. Because the encoding attribute is gone,<gadget>is now parsed as MathML. - The gadget is written in such a way that it exploits the parsing differences between HTML and MathML.
Additionally, the gadget can only be written using a tag that is parsed as raw text in HTML. These elements are:
- title
- textarea
- xmp
- iframe
- noembed
- noframes
- plaintext
- noscript
- style
- script
Applications that do not explicitly allow any of these tags should not be affected, since none are allowed by default.
Impact
Low: Requires both MathML and at least one raw-text HTML tag to be enabled, and most websites don't enable either of those.
Patches
- https://github.com/rust-ammonia/ammonia/pull/245 (released in 4.1.3)
- https://github.com/rust-ammonia/ammonia/pull/244 (released in 4.0.2)
- https://github.com/rust-ammonia/ammonia/pull/243 (released in 3.3.2)
Workarounds
Call builder.add_clean_content_tags("annotation-xml") to remove the annotation-xml element and all of its children, including the XSS gadget.
Advisory Timeline
- First published October 22, 2026 (35 days ago).
- Last revised October 22, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
cargo update -p ammonia --precise 3.3.2
cargo update -p ammonia --precise 4.1.3
cargo update -p ammonia --precise 4.0.2
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (3)
Affects 1 ecosystem: crates.io (1).
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-79Cross-site Scripting (XSS)MITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 6.6 score means for each attack dimension.
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
References
- https://github.com/rust-ammonia/ammonia/security/advisories/GHSA-9jh8-v38h-cvhrWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-63430ADVISORY
- https://github.com/rust-ammonia/ammonia/pull/243WEB
- https://github.com/rust-ammonia/ammonia/pull/244WEB
- https://github.com/rust-ammonia/ammonia/pull/245WEB
- https://github.com/rust-ammonia/ammonia/commit/004bf2cee4288f74a6ee619d589e3e90c24c09caWEB
- https://github.com/rust-ammonia/ammonia/commit/7ac3fd3145236f28857eeecbadb544c8659cba31WEB
- https://github.com/rust-ammonia/ammonia/commit/b51bf4f9749ed3cd518330105f20a2c39c9ee274WEB
- https://github.com/rust-ammonia/ammoniaPACKAGE
- https://github.com/rust-ammonia/ammonia/releases/tag/v3.3.2WEB
- https://github.com/rust-ammonia/ammonia/releases/tag/v4.0.2WEB
- https://github.com/rust-ammonia/ammonia/releases/tag/v4.1.3WEB
- https://ivan09999.github.io/ammonia-mxssWEB
- https://rustsec.org/advisories/RUSTSEC-2026-0193.htmlWEB
Frequently Asked Questions
- What is CVE-2026-63430?
- ammonia: mXSS via MathML `annotation-xml` encoding strip. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.6/10).
- How do I check if my project is affected by CVE-2026-63430?
- CVE-2026-63430 affects ammonia. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-63430 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is an above-median EPSS score — 50.7% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2019-15542HIGH
Uncontrolled recursion leads to abort in HTML serialization
- CVE-2026-115906MEDIUM
zip: AES Entry HMAC Authentication Bypass on Premature EOF
- CVE-2026-35374MEDIUM
split: TOCTOU output-open allows truncating a swapped file
- CVE-2026-102342MEDIUM
Ammonia: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')