Skip to main content

CVE-2026-63430 — Vulnerability in ammonia — CVE Details

MEDIUM

ammonia: mXSS via MathML `annotation-xml` encoding strip

Published October 22, 2026Updated October 22, 2026Source: OSV

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.

Check my Cargo.lock

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:

  1. User writes code like <math><annotation-xml encoding="text/html"><gadget></annotation-xml></math>.
  2. Namespace filtering checks the DOM, and it passes. <gadget> is parsed as HTML.
  3. 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.
  4. 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

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 ammonia to 3.3.2 or later
cargo update -p ammonia --precise 3.3.2
Cargo
Update ammonia to 4.1.3 or later
cargo update -p ammonia --precise 4.1.3
Cargo
Update ammonia to 4.0.2 or later
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).

PackageFixed In
ammonia crates.io · Affected: All versions3.3.2
ammonia crates.io · Affected: All versions4.1.3
ammonia crates.io · Affected: All versions4.0.2

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.6 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
—
Confidentiality
—
Integrity
—
Availability
—

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

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

CVSS Score
6.6

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.74%
EPSS percentile: 50.7

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

GHSA-9jh8-v38h-cvhr
RUSTSEC-2026-0193

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Cargo.lock