GHSA-934p-vp7m-gx3c: Incorrect handling of embedded SVG and MathML leads to mutation XSS
Published 2026-11-12 · Updated 2026-11-13 · Also known as RUSTSEC-2026-0533
Summary
Incorrect handling of embedded SVG and MathML in the ammonia crate can lead to mutation XSS due to parsing discrepancies between HTML and foreign XML. Engineering teams using ammonia must update to the fixed versions.
Who is affected
Affected deployments allow MathML text integration points or SVG foreignObject to contain tags in the other namespace without a root tag that switches out of the HTML namespace. Attackers can exploit parsing differences between HTML and foreign XML to inject arbitrary JavaScript code, provided the application allows specific raw text elements like title, textarea, xmp, iframe, noembed, noframes, plaintext, noscript, style, or script.
Exploitability
The CVSS vector, base score, and EPSS are not documented. CISA KEV active exploitation is no.
Remediation
- Upgrade crates.io ammonia to version 3.3.5, 4.1.9, 4.2.5, or later.
- Ensure applications do not explicitly allow raw text elements if they are not needed.
How to check your project
- Check Cargo.toml and Cargo.lock in Rust projects to determine if the ammonia crate is used within version ranges 0.0.0 up to 3.3.5, 4.0.0 up to 4.1.9, or 4.2.0 up to 4.2.5.
Automated analysis of the published advisory data, generated 2026-11-19. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| crates.io | ammonia |
>= 0.0.0-0, < 3.3.5 | 3.3.5 | cargo update -p ammonia --precise 3.3.5 |
| crates.io | ammonia |
>= 4.0.0, < 4.1.9 | 4.1.9 | cargo update -p ammonia --precise 4.1.9 |
| crates.io | ammonia |
>= 4.2.0, < 4.2.5 | 4.2.5 | cargo update -p ammonia --precise 4.2.5 |
FAQ
What packages are affected by this vulnerability?
The crates.io package ammonia is affected in version ranges introduced 0.0.0-0 and fixed in 3.3.5, introduced 4.0.0 and fixed in 4.1.9, and introduced 4.2.0 and fixed in 4.2.5.
Are applications using default settings affected?
Applications that do not explicitly allow any of the specified raw text tags should not be affected, since none are allowed by default.
Who reported the vulnerability?
The vulnerability was reported by Roger Meyer.
Original advisory description
References
- PACKAGE https://crates.io/crates/ammonia
- ADVISORY https://rustsec.org/advisories/RUSTSEC-2026-0533.html
- WEB https://github.com/rust-ammonia/ammonia/pull/269
Source records: RUSTSEC-2026-0533 (OSV.dev).