RUSTSEC-2026-0533

Source
https://rustsec.org/advisories/RUSTSEC-2026-0533
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0533.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2026-0533
Aliases
  • GHSA-934p-vp7m-gx3c
Published
2026-11-12T12:00:00Z
Modified
2026-11-13T12:45:09Z
Summary
Incorrect handling of embedded SVG and MathML leads to mutation XSS
Details

The MathML text integration points (mi, mo, mn, ms, mtext) and SVG foreignObject can be made to contain a tag in the other one's namespace (a MathML integration point with a child in the SVG namespace, or vice versa) without the root tag that switches out of the HTML namespace. If the attacker can construct input that parses differently in as HTML than as foreign XML, they can inject arbitrary JavaScript code into the user's browser.

For example:

  • The user writes <math><mi><svg><gadget></svg></mi></math>.
  • The application enables math, mi, and the gadget, but not svg.
  • Ammonia filters the input to <math><mi><gadget></mi></math>.
  • Because svg is now gone, the gadget switches from being parsed as SVG to being parsed as HTML.
  • The gadget is written in such a way that it exploits the parsing differences between HTML and MathML.

As far as we know, the gadget can only be written using 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.


This vulnerability was reported by Roger Meyer.

Database specific
{
    "license": "CC0-1.0"
}
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
0.0.0-0
Fixed
3.3.5
Introduced
4.0.0
Fixed
4.1.9
Introduced
4.2.0
Fixed
4.2.5

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "arch": [],
        "functions": [],
        "os": []
    }
}

Database specific

categories
[
    "format-injection"
]
cvss
null
informational
null
source
"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0533.json"