Skip to content

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

LowCVSS 1.7
Published
Updated
Exploit status
No public exploit known

Description

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.

Upgrade path

1 package: 1 fixed.

PackageAffectedFixed inStatus
crates.io ammonia(crates.io) < 3.3.1; >= 0.0.0-0, < 3.3.1; >= 4.0.0, < 4.0.1; >= 4.1.0, < 4.1.2 3.3.1, 4.0.1, 4.1.2 Fixed

Affected products

ProductAffected versionsFixed in
crates.io ammonia(crates.io) >= 4.1.0, < 4.1.2 4.1.2
crates.io ammonia(crates.io) >= 4.0.0, < 4.0.1 4.0.1
crates.io ammonia(crates.io) < 3.3.1 3.3.1
crates.io ammonia(crates.io) >= 0.0.0-0, < 3.3.1 3.3.1

References