CVE-2021-38186 Cross-site Scripting in comrak
Attackers can execute arbitrary scripts in user browsers by exploiting improper handling of HTML entities in the comrak Rust library.
- 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-38186?
CVE-2021-38186 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 comrak crate before 0.10.1 for Rust. It mishandles & characters, leading to XSS via &# HTML entities.
Weakness: CWE-79
Which versions are affected by CVE-2021-38186?
3 open source packages ship an affected version, including comrak. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
comrak crates.io | All versions | 0.10.1 |
comrak crates.io | All versions | 0.10.1 |
comrak crates.io | From 0.0.0-0 | 0.10.1 |
Products include Comrak Project Comrak.
How do I fix CVE-2021-38186?
Upgrade comrak to 0.10.1 or later.
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-38186 being exploited?
There is no known exploitation of CVE-2021-38186 in the wild and no public exploit code.
Other vulnerabilities in n/a
Sources
Also known as GHSA-6wj2-g87r-pm62, RUSTSEC-2021-0063.