Ammonia incorrectly handles embedded SVG and MathML leading to mutation XSS after removal
Low severity
GitHub Reviewed
Published
Sep 22, 2025
to the GitHub Advisory Database
•
Updated Sep 22, 2025
Package
Affected versions
>= 4.1.0, < 4.1.2
>= 4.0.0, < 4.0.1
< 3.3.1
Patched versions
4.1.2
4.0.1
3.3.1
Description
Published to the GitHub Advisory Database
Sep 22, 2025
Reviewed
Sep 22, 2025
Last updated
Sep 22, 2025
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
ormath
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:
Applications that do not explicitly allow any of these tags should not be affected, since none are allowed by default.
References