NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Rust (crates.io)

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

lowCVSS 4.0 1.7

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.

Published Sep 22, 2025

Affected packages

ammonia

Ecosystem
Rust (crates.io)
Affected
>= 4.1.0, < 4.1.2
Fixed in
4.1.2
Check
cargo tree -i ammonia

ammonia

Ecosystem
Rust (crates.io)
Affected
>= 4.0.0, < 4.0.1
Fixed in
4.0.1
Check
cargo tree -i ammonia

ammonia

Ecosystem
Rust (crates.io)
Affected
< 3.3.1
Fixed in
3.3.1
Check
cargo tree -i ammonia

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More Rust (crates.io) vulnerabilities

All Rust (crates.io) entries