CVE-2026-63430: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in rust-ammonia ammonia
Description
ammonia is a Rust library for repairing and securing untrusted HTML. Prior to 3.3.2, 4.0.2, and 4.1.3, applications that explicitly allow the math tag, annotation-xml, and at least one raw-text HTML element while disallowing the encoding attribute can permit mutation cross-site scripting. ammonia does not correctly implement annotation-xml's encoding-dependent MathML integration-point behavior after attribute filtering removes encoding, so the sanitizer validates a descendant under one namespace interpretation while the browser reparses the output under another. An attacker can use that namespace transition and an allowed raw-text HTML element to execute JavaScript when a user renders the sanitized output. The required tags are not enabled by default, so applications that do not explicitly allow them are not affected. This issue is fixed in versions 3.3.2, 4.0.2, and 4.1.3.
CVSS v4.0
Score 6.3medium
Affected software
rust-ammonia
ammonia
pkg:cargo/rust-ammonia/ammoniaRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The rust-ammonia library, used for sanitizing untrusted HTML, improperly handles annotation-xml's encoding-dependent MathML integration-point behavior after attribute filtering removes the encoding attribute. This leads to a mismatch between the sanitizer's namespace validation and the browser's reparsing, enabling mutation cross-site scripting (CWE-79) when certain tags (math, annotation-xml, and raw-text HTML elements) are allowed. This vulnerability affects versions prior to 3.3.2, versions from 4.0.0 up to but not including 4.0.2, and versions from 4.1.0 up to but not including 4.1.3. The vulnerability is medium severity with a CVSS 4.0 score of 6.3. The issue is resolved in versions 3.3.2, 4.0.2, and 4.1.3.
Potential Impact
An attacker can exploit this vulnerability to execute arbitrary JavaScript in the context of a user's browser when rendering sanitized HTML output. This can lead to typical XSS impacts such as session hijacking or unauthorized actions. However, the vulnerability only affects applications that explicitly enable the vulnerable tags and disable the encoding attribute, limiting the scope of impact.
Mitigation Recommendations
Upgrade rust-ammonia to version 3.3.2, 4.0.2, or 4.1.3 or later, where this vulnerability is fixed. Applications that do not explicitly allow the math tag, annotation-xml, and raw-text HTML elements are not affected. No other mitigation is required if these tags are not enabled.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-07-16T19:35:57.766Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6ad11cac2cdf04f6565042e6
Added to database: 10/15/2026, 18:34:20 UTC
Last enriched: 10/15/2026, 18:48:32 UTC
Last updated: 10/15/2026, 20:49:08 UTC
Views: 10
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.