{"id":"GHSA-9jh8-v38h-cvhr","revision":"3c6e75f226cb485d930ab7004a3f7bbf","records":[{"revision":"3c6e75f226cb485d930ab7004a3f7bbf","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"GHSA-9jh8-v38h-cvhr","aliases":["CVE-2026-63430","RUSTSEC-2026-0193"],"title":"ammonia: mXSS  via MathML `annotation-xml` encoding strip","description":"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.","state":0,"publishedAt":"2026-10-22T14:06:10+00:00","modifiedAt":"2026-10-22T14:16:23.1036506+00:00","affected":[{"ecosystem":"crates.io","name":"ammonia","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"3.3.2"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"crates.io","name":"ammonia","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"4.0.0"},{"kind":"fixed","version":"4.0.2"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"crates.io","name":"ammonia","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"4.1.0"},{"kind":"fixed","version":"4.1.3"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"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","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/rust-ammonia/ammonia/security/advisories/GHSA-9jh8-v38h-cvhr","https://nvd.nist.gov/vuln/detail/CVE-2026-63430","https://github.com/rust-ammonia/ammonia/pull/243","https://github.com/rust-ammonia/ammonia/pull/244","https://github.com/rust-ammonia/ammonia/pull/245","https://github.com/rust-ammonia/ammonia/commit/004bf2cee4288f74a6ee619d589e3e90c24c09ca","https://github.com/rust-ammonia/ammonia/commit/7ac3fd3145236f28857eeecbadb544c8659cba31","https://github.com/rust-ammonia/ammonia/commit/b51bf4f9749ed3cd518330105f20a2c39c9ee274","https://github.com/rust-ammonia/ammonia","https://github.com/rust-ammonia/ammonia/releases/tag/v3.3.2","https://github.com/rust-ammonia/ammonia/releases/tag/v4.0.2","https://github.com/rust-ammonia/ammonia/releases/tag/v4.1.3","https://ivan09999.github.io/ammonia-mxss","https://rustsec.org/advisories/RUSTSEC-2026-0193.html"],"sourceUrl":"https://github.com/advisories/GHSA-9jh8-v38h-cvhr","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-9jh8-v38h-cvhr","identifiers":["GHSA-9jh8-v38h-cvhr","CVE-2026-63430","RUSTSEC-2026-0193"]},"retained":false,"historicalAffected":[]}],"coverage":[]}