CVE-2021-42576 Policies not properly enforced in bluemonday
Attackers can inject malicious scripts via SELECT, STYLE, or OPTION elements due to improper policy enforcement in the bluemonday sanitizer.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-42576?
CVE-2021-42576 is a critical cross-site scripting vulnerability in n/a, published on 18 Oct 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
The bluemonday sanitizer before 1.0.16 for Go, and before 0.0.8 for Python (in pybluemonday), does not properly enforce policies associated with the SELECT, STYLE, and OPTION elements.
Which versions are affected by CVE-2021-42576?
6 open source packages ship an affected version, including github.com/microcosm-cc/bluemonday and pybluemonday. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
github.com/microcosm-cc/bluemonday Go | All versions | 1.0.16 |
github.com/microcosm-cc/bluemonday Go | All versions | 1.0.16 |
github.com/microcosm-cc/bluemonday Go | All versions | 1.0.16 |
pybluemonday PyPI | All versions | 0.0.8 |
pybluemonday PyPI | All versions | 0.0.8 |
pybluemonday PyPI | All versions | 0.0.8 |
Products include Microco Bluemonday, Python Pybluemonday.
How do I fix CVE-2021-42576?
Upgrade github.com/microcosm-cc/bluemonday to 1.0.16 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-42576 being exploited?
There is no known exploitation of CVE-2021-42576 in the wild and no public exploit code.
Other vulnerabilities in n/a
Sources
Also known as DEBIAN-CVE-2021-42576, GHSA-x95h-979x-cf3j, GO-2022-0588, PYSEC-2021-849, UBUNTU-CVE-2021-42576.