CVE-2021-38193 Cross-site Scripting in ammonia
Attackers can inject malicious scripts via mishandled HTML, SVG, and MathML parsing in the ammonia Rust crate, leading to XSS.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-38193?
CVE-2021-38193 is a medium-severity cross-site scripting vulnerability in n/a, published on 8 Aug 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
An issue was discovered in the ammonia crate before 3.1.0 for Rust. XSS can occur because the parsing differences for HTML, SVG, and MathML are mishandled, a similar issue to CVE-2020-26870.
Weakness: CWE-79
Which versions are affected by CVE-2021-38193?
5 open source packages ship an affected version, including ammonia. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
ammonia crates.io | All versions | 2.1.3 |
ammonia crates.io | All versions | 2.1.3 |
ammonia crates.io | From 0.0.0-0 | 2.1.3, 3.1.0 |
ammonia crates.io | From 3.0.0 | 3.1.0 |
ammonia crates.io | From 3.0.0 | 3.1.0 |
Products include Ammonia Project Ammonia.
How do I fix CVE-2021-38193?
Upgrade ammonia to a fixed version for your release line: 2.1.3 or 3.1.0.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2021-38193 being exploited?
There is no known exploitation of CVE-2021-38193 in the wild and no public exploit code.
Other vulnerabilities in n/a
Sources
Also known as DEBIAN-CVE-2021-38193, GHSA-5325-xw5m-phm3, RUSTSEC-2021-0074, UBUNTU-CVE-2021-38193.