Search

Find a vulnerability

Search criteria

    Related vulnerabilities

    RUSTSEC-2026-0533 (GHSA-934P-VP7M-GX3C)

    Vulnerability from osv_rustsec – Published: 2026-11-12 12:00 – Updated: 2026-11-13 12:33 – Source website
    VLAI
    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.


    {
      "affected": [
        {
          "database_specific": {
            "categories": [
              "format-injection"
            ],
            "cvss": null,
            "informational": null
          },
          "ecosystem_specific": {
            "affected_functions": null,
            "affects": {
              "arch": [],
              "functions": [],
              "os": []
            }
          },
          "package": {
            "ecosystem": "crates.io",
            "name": "ammonia",
            "purl": "pkg:cargo/ammonia"
          },
          "ranges": [
            {
              "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"
                }
              ],
              "type": "SEMVER"
            }
          ],
          "versions": []
        }
      ],
      "aliases": [
        "GHSA-934p-vp7m-gx3c"
      ],
      "database_specific": {
        "license": "CC0-1.0"
      },
      "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\u0027s 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\u0027s browser.\n\nFor example:\n\n- The user writes `\u003cmath\u003e\u003cmi\u003e\u003csvg\u003e\u003cgadget\u003e\u003c/svg\u003e\u003c/mi\u003e\u003c/math\u003e`.\n- The application enables `math`, `mi`, and the gadget, but not `svg`.\n- Ammonia filters the input to `\u003cmath\u003e\u003cmi\u003e\u003cgadget\u003e\u003c/mi\u003e\u003c/math\u003e`.\n- Because svg is now gone, the gadget switches from being parsed as SVG to being parsed as HTML.\n- The gadget is written in such a way that it exploits the parsing differences between HTML and MathML.\n\nAs far as we know, the gadget can only be written using a tag that is parsed as raw text in HTML. These [elements] are:\n\n- title\n- textarea\n- xmp\n- iframe\n- noembed\n- noframes\n- plaintext\n- noscript\n- style\n- script\n\nApplications that do not explicitly allow any of these tags should not be affected, since none are allowed by default.\n\n[elements]: https://github.com/servo/html5ever/blob/a027c2835472d518893c906dc29c42200af3c960/html5ever/src/tree_builder/rules.rs\n\n---\n\nThis vulnerability was reported by Roger Meyer.",
      "id": "RUSTSEC-2026-0533",
      "modified": "2026-11-13T12:33:03Z",
      "published": "2026-11-12T12:00:00Z",
      "references": [
        {
          "type": "PACKAGE",
          "url": "https://crates.io/crates/ammonia"
        },
        {
          "type": "ADVISORY",
          "url": "https://rustsec.org/advisories/RUSTSEC-2026-0533.html"
        },
        {
          "type": "WEB",
          "url": "https://github.com/rust-ammonia/ammonia/pull/269"
        }
      ],
      "related": [],
      "severity": [],
      "summary": "Incorrect handling of embedded SVG and MathML leads to mutation XSS"
    }