Skip to content
Fencer Intel
low —

GHSA-mm7x-qfjj-5g2c json

Ammonia incorrectly handles embedded SVG and MathML leading to mutation XSS after removal

published last yr. modified 2mo ago also RUSTSEC-2025-0071

cvss
—
not scored
cisa kev
Not listed
not in CISA's catalog
epss
—
no score, EPSS covers CVEs only
public exploits
0
none known

Summary

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

Patch / fix

  • crates.io ammonia 3.3.1, 4.0.1, 4.1.2

Is GHSA-mm7x-qfjj-5g2c in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Affected packages

ecosystem package affected fixed in
crates.io ammonia
>=4.1.0, <4.1.2
>=4.0.0, <4.0.1
<3.3.1
>=0.0.0-0, <3.3.1
4.1.2
4.0.1
3.3.1

Classification

Weakness
  • CWE-79 Improper Neutralization of Input During Web Page Generation

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.