# CVE-2026-63430: Rust Ammonia XSS via MathML annotation-xml encoding strip

Source: https://junglewise.ai/threats/cve-2026-63430-rustsec-2026-0193-mxss-in-ammonia-via-mathml-annotation-xml  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-22. Updated: 2026-10-22  
License: CC BY 4.0 with a link back

CVE-2026-63430 · Severity: medium · CVSS 4 · Published 2026-10-22

Ammonia is a Rust library that sanitizes HTML to prevent malicious code injection. When MathML support and certain HTML tags are enabled together, an attacker can craft a malicious HTML snippet that bypasses the sanitizer's defenses, allowing arbitrary JavaScript execution in a user's browser. This requires non-default configuration of the sanitizer.

Technologies: [ammonia (crates.io)](https://junglewise.ai/threats/technologies/ammonia). Vendors: [crates.io](https://junglewise.ai/threats/vendors/crates-io).

## Quick answers

**Is CVE-2026-63430 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-63430 being exploited in the wild.

**How severe is CVE-2026-63430?** Medium severity, with a CVSS score of 4, published 22 October 2026.

**Which products and versions are affected?** ammonia (crates.io) < 3.3.2, SEMVER:introduced=0,fixed=3.3.2, SEMVER:introduced=0.0.0-0,fixed=3.3.2,introduced=4.0.0,fixed=4.0.2,introduced=4.1.0,fixed=4.1.3; Rust-Ammonia Ammonia before 3.3.2, 4.0.2, 4.1.3.

**Is there a fix for CVE-2026-63430?** Yes. ammonia (crates.io): upgrade to 3.3.2, 4.1.3 or later. Until then: Call builder.add_clean_content_tags("annotation-xml") to remove the annotation-xml element and all of its children, preventing the XSS gadget from being parsed. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-63430 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-63430?** Check whether you run ammonia (crates.io) or Rust-Ammonia Ammonia at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- ammonia (crates.io): upgrade to 3.3.2, 4.1.3 or later

  ```sh
  cargo update -p ammonia
  ```


Call builder.add_clean_content_tags("annotation-xml") to remove the annotation-xml element and all of its children, preventing the XSS gadget from being parsed.

## Technical details

The vulnerability is a mutated XSS (mXSS) that exploits differences in how HTML and MathML parsers handle the `annotation-xml` tag. When the `encoding` attribute is stripped by the attribute filter but the tag remains, child elements previously parsed as HTML become reinterpreted as MathML, enabling exploitation via raw-text elements (script, style, textarea, etc.). The attack vector requires an attacker to control HTML input and the application to enable both MathML and at least one raw-text tag in the sanitizer configuration.

## Affected products

- Rust Ammonia Ammonia before 3.3.2, 4.0.2, 4.1.3

## Identifiers

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

## Timeline

- 2026-10-22: disclosed
- 2026-10-22: patched: patches released in versions 3.3.2, 4.0.2, 4.1.3

## Related threats

- [ammonia CSS url function case-sensitivity bypass](https://junglewise.ai/threats/rustsec-2026-0373-missing-case-insensitive-matching-for-css-url-0b78f36f)
- [Ammonia cross-site scripting in SVG animate and set tags](https://junglewise.ai/threats/cve-2026-102342-ammonia-improper-neutralization-of-input-during-web-page)
- [RUSTSEC-2026-0213 - XSS in ammonia via SVG `animate` and `set` animation tags](https://junglewise.ai/threats/rustsec-2026-0213-xss-in-ammonia-via-svg-animate-and-set-animation-tags-3d7360b1)
- [Ammonia incorrectly handles embedded SVG and MathML leading to mutation XSS after removal](https://junglewise.ai/threats/ammonia-incorrectly-handles-embedded-svg-and-mathml-leading-to-mutation-c72e022f)
- [RUSTSEC-2025-0071 - Incorrect handling of embedded SVG and MathML leads to mutation XSS after removal](https://junglewise.ai/threats/rustsec-2025-0071-incorrect-handling-of-embedded-svg-and-mathml-leads-d1eb16ba)
