{"id":"CVE-2026-63430","aliases":["GHSA-9jh8-v38h-cvhr","RUSTSEC-2026-0193"],"url":"https://o3.security/vulnerability/CVE-2026-63430","summary":"ammonia: mXSS in ammonia via MathML `annotation-xml` encoding strip","details":"If a certain set of MathML tags are enabled, an attacker can inject arbitrary JavaScript code into the user's browser.\n\nThe `annotation-xml` tag has slightly different behavior than the other \"integration point\"\ntags in MathML and SVG, but ammonia didn't handle it, so it didn't correctly\nstrip the namespace-incompatible tags.\n\nThis vulnerability only has an effect when the `math` and `annotation-xml` tags\nare both enabled, but the `encoding` attribute is disabled, because it relies\non the following sequence of steps:\n\n1. User writes code like `<math><annotation-xml encoding=\"text/html\"><gadget></annotation-xml></math>`.\n2. Namespace filtering checks the DOM, and it passes. `<gadget>` is parsed as HTML.\n3. Attribute filter strips it down to `<math><annotation-xml><gadget></annotation-xml></math>`. Because the encoding attribute is gone, `<gadget>` is now parsed as MathML.\n4. The gadget is written in such a way that it exploits the parsing differences between HTML and MathML.\n\nAdditionally, the gadget can only be written using a tag that is parsed as raw text in HTML.\nThese [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/045a0378f2b0f8d4a350793899cf722a2a9b3d11/html5ever/src/tree_builder/rules.rs\n\n### Impact\n\nLow: Requires both MathML and at least one raw-text HTML tag to be enabled, and most websites don't enable either of those.\n\n### Patches\n\n- https://github.com/rust-ammonia/ammonia/pull/245 (released in 4.1.3)\n- https://github.com/rust-ammonia/ammonia/pull/244 (released in 4.0.2)\n- https://github.com/rust-ammonia/ammonia/pull/243 (released in 3.3.2)\n\n### Workarounds\n\nCall <code>builder.[add_clean_content_tags](https://docs.rs/ammonia/latest/ammonia/struct.Builder.html#method.add_clean_content_tags)(\"annotation-xml\")</code> to remove the annotation-xml element and all of its children, including the XSS gadget.","published":"2026-10-15T18:10:35.869Z","modified":"2026-10-21T02:58:56.136415807Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"crates.io","name":"ammonia","fixedVersion":"3.3.2"},{"ecosystem":"crates.io","name":"ammonia","fixedVersion":"4.0.2"},{"ecosystem":"crates.io","name":"ammonia","fixedVersion":"4.1.3"}],"fix":{"url":"https://github.com/rust-ammonia/ammonia/commit/004bf2cee4288f74a6ee619d589e3e90c24c09ca","label":"rust-ammonia/ammonia@004bf2c"},"references":[{"type":"WEB","url":"https://github.com/rust-ammonia/ammonia/releases/tag/v3.3.2"},{"type":"WEB","url":"https://github.com/rust-ammonia/ammonia/releases/tag/v4.0.2"},{"type":"WEB","url":"https://github.com/rust-ammonia/ammonia/releases/tag/v4.1.3"},{"type":"WEB","url":"https://ivan09999.github.io/ammonia-mxss"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/63xxx/CVE-2026-63430.json"},{"type":"ADVISORY","url":"https://github.com/rust-ammonia/ammonia/security/advisories/GHSA-9jh8-v38h-cvhr"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63430"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0193.html"},{"type":"FIX","url":"https://github.com/rust-ammonia/ammonia/commit/004bf2cee4288f74a6ee619d589e3e90c24c09ca"},{"type":"FIX","url":"https://github.com/rust-ammonia/ammonia/commit/7ac3fd3145236f28857eeecbadb544c8659cba31"},{"type":"FIX","url":"https://github.com/rust-ammonia/ammonia/commit/b51bf4f9749ed3cd518330105f20a2c39c9ee274"},{"type":"FIX","url":"https://github.com/rust-ammonia/ammonia/pull/243"},{"type":"FIX","url":"https://github.com/rust-ammonia/ammonia/pull/244"},{"type":"FIX","url":"https://github.com/rust-ammonia/ammonia/pull/245"},{"type":"PACKAGE","url":"https://github.com/rust-ammonia/ammonia"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-21T02:58:56.136415807Z"}}