RUSTSEC-2025-0071

Source
https://rustsec.org/advisories/RUSTSEC-2025-0071
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2025-0071.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2025-0071
Aliases
Published
2025-09-21T12:00:00Z
Modified
2025-10-28T06:29:25.438486Z
Summary
Incorrect handling of embedded SVG and MathML leads to mutation XSS after removal
Details

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.

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / ammonia

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
3.3.1
Introduced
4.0.0
Fixed
4.0.1
Introduced
4.1.0
Fixed
4.1.2

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "arch": [],
        "functions": [],
        "os": []
    }
}

Database specific

categories
[
    "format-injection"
]
source
"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2025-0071.json"
informational
null
cvss
null