CVE-2021-27671 Cross site scripting in comrak
Attackers can execute arbitrary scripts via case-sensitive URI bypasses in the comrak Rust library, affecting applications rendering untrusted Markdown.
- 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-27671?
CVE-2021-27671 is a medium-severity cross-site scripting vulnerability in n/a, published on 25 Feb 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.9.1 for Rust. XSS can occur because the protection mechanism for data: and javascript: URIs is case-sensitive, allowing (for example) Data: to be used in an attack.
Weakness: CWE-79
Which versions are affected by CVE-2021-27671?
3 open source packages ship an affected version, including comrak. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
comrak crates.io | All versions | 0.9.1 |
comrak crates.io | All versions | 0.9.1 |
comrak crates.io | From 0.0.0-0 | 0.9.1 |
Products include Comrak Project Comrak.
How do I fix CVE-2021-27671?
Upgrade comrak to 0.9.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-27671 being exploited?
There is no known exploitation of CVE-2021-27671 in the wild and no public exploit code.
Other vulnerabilities in n/a
Sources
Also known as GHSA-xmr7-v725-2jjr, RUSTSEC-2021-0026.