GHSA-mm7x-qfjj-5g2c

Suggest an improvement
Source
https://github.com/advisories/GHSA-mm7x-qfjj-5g2c
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/09/GHSA-mm7x-qfjj-5g2c/GHSA-mm7x-qfjj-5g2c.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-mm7x-qfjj-5g2c
Aliases
Downstream
CGA (6)
Published
2025-09-22T15:40:15Z
Modified
2026-09-10T03:50:28Z
Severity
  • 1.7 (Low) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:U CVSS Calculator
Summary
Ammonia incorrectly handles embedded SVG and MathML leading 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
{
    "cwe_ids":  [
        "CWE-79"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2025-09-22T15:40:15Z",
    "nvd_published_at":  null,
    "severity":  "LOW"
}
References

Affected packages

crates.io / ammonia

Package

Name
ammonia
View open source insights on deps.dev
Purl
pkg:cargo/ammonia

Affected ranges

Type
SEMVER
Events
Introduced
4.1.0
Fixed
4.1.2

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/09/GHSA-mm7x-qfjj-5g2c/GHSA-mm7x-qfjj-5g2c.json"

crates.io / ammonia

Package

Name
ammonia
View open source insights on deps.dev
Purl
pkg:cargo/ammonia

Affected ranges

Type
SEMVER
Events
Introduced
4.0.0
Fixed
4.0.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/09/GHSA-mm7x-qfjj-5g2c/GHSA-mm7x-qfjj-5g2c.json"

crates.io / ammonia

Package

Name
ammonia
View open source insights on deps.dev
Purl
pkg:cargo/ammonia

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
3.3.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/09/GHSA-mm7x-qfjj-5g2c/GHSA-mm7x-qfjj-5g2c.json"