Read the docs
TI-2025-43774 Aliases GHSA-mm7x-qfjj-5g2c

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

Priority LOW 38CWE-79Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
Cross-site scripting
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-79.

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

Why it matters now

Fix Fixed ammonia (crates.io): 4.1.2, 4.0.1, 3.3.1

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—ammonia (crates.io)4.1.0 to before 4.1.24.1.2Patch availableGHSA-mm7x-qfjj-5g2c
—ammonia (crates.io)4.0.0 to before 4.0.14.0.1Patch availableGHSA-mm7x-qfjj-5g2c
—ammonia (crates.io)before 3.3.13.3.1Patch availableGHSA-mm7x-qfjj-5g2c
  • ammonia (crates.io) Vendor— Affected 4.1.0 to before 4.1.2 Fixed in 4.1.2 Patch available GHSA-mm7x-qfjj-5g2c
  • ammonia (crates.io) Vendor— Affected 4.0.0 to before 4.0.1 Fixed in 4.0.1 Patch available GHSA-mm7x-qfjj-5g2c
  • ammonia (crates.io) Vendor— Affected before 3.3.1 Fixed in 3.3.1 Patch available GHSA-mm7x-qfjj-5g2c

Remediation

  • Fix · GHSA-mm7x-qfjj-5g2c ammonia (crates.io) Fixed in 4.1.2 Advisory →
  • Fix · GHSA-mm7x-qfjj-5g2c ammonia (crates.io) Fixed in 4.0.1 Advisory →
  • Fix · GHSA-mm7x-qfjj-5g2c ammonia (crates.io) Fixed in 3.3.1 Advisory →

Timeline

  1. 2026-10-03 Threatist record created from GHSA-mm7x-qfjj-5g2c

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences