# GHSA-mm7x-qfjj-5g2c: Ammonia incorrectly handles embedded SVG and MathML leading to mutation XSS after removal

- Severity: Low (CVSS:4.0, scored by GitHub) `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/E:U`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2025-09-21T12:00:00.000Z
- Modified: 2026-09-10T03:50:28.411Z
- Also known as: RUSTSEC-2025-0071
- Weaknesses: CWE-79

## Description

Affected versions of this crate did not correctly strip namespace-incompatible tags
in certain situations, causing it to incorrectly account for differences between HTML,
SVG, and MathML.

This vulnerability only has an effect when the `svg` or `math` tag is allowed,
because it relies on a tag being parsed as html during the cleaning process, but
serialized in a way that causes in to be parsed as xml by the browser.

Additionally, the application using this library must allow 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.

[elements]: https://github.com/servo/html5ever/blob/57eb334c0ffccc6f88d563419f0fbeef6ff5741c/html5ever/src/tree_builder/rules.rs

(As written by GitHub Advisory Database.)

## Affected

- ammonia (crates.io): from 4.1.0 before 4.1.2; from 4.0.0 before 4.0.1; before 3.3.1; from 0.0.0-0 before 3.3.1

## References

- <https://github.com/rust-ammonia/ammonia/commit/de0297111a3a1273275b670960bcd47a0481718e> (web)
- <https://github.com/rust-ammonia/ammonia> (package)
- <https://rustsec.org/advisories/RUSTSEC-2025-0071.html> (advisory, web)
- <https://crates.io/crates/ammonia> (package)

## Sources

- GitHub Advisory Database: [GHSA-mm7x-qfjj-5g2c](https://github.com/advisories/GHSA-mm7x-qfjj-5g2c), CC-BY-4.0, modified 2026-09-10
- RustSec Advisory Database: [RUSTSEC-2025-0071](https://rustsec.org/advisories/RUSTSEC-2025-0071.html), CC0-1.0, modified 2025-10-28

---

Page: https://cve.day/GHSA-mm7x-qfjj-5g2c · Whole record: https://cve.day/GHSA-mm7x-qfjj-5g2c.json · Rebuilt by cve.day 2026-11-25T22:56:43.268Z
