Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. ammonia
  4. ›
  5. GHSA-mm7x-qfjj-5g2c

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

September 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 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.

References

  • github.com/advisories/GHSA-mm7x-qfjj-5g2c
  • github.com/rust-ammonia/ammonia
  • github.com/rust-ammonia/ammonia/commit/de0297111a3a1273275b670960bcd47a0481718e
  • rustsec.org/advisories/RUSTSEC-2025-0071.html

Code Behaviors & Features

Detect and mitigate GHSA-mm7x-qfjj-5g2c with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.3.1, all versions starting from 4.0.0 before 4.0.1, all versions starting from 4.1.0 before 4.1.2

Fixed versions

  • 4.1.2
  • 4.0.1
  • 3.3.1

Solution

Upgrade to versions 3.3.1, 4.0.1, 4.1.2 or above.

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

cargo/ammonia/GHSA-mm7x-qfjj-5g2c.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 30 Sep 2025 12:20:47 +0000.