🛡️ CVE-2021-42576 — pybluemonday

🟠 CVSS 8.0 — High ✅ No Known Exploit CWE-20 OSV
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Cross-site scripting via leaked style elements in github.com/microcosm-cc/bluemonday

The bluemonday HTML sanitizer can leak the contents of a "style" element into HTML output, potentially causing XSS vulnerabilities.

The default bluemonday sanitization policies are not vulnerable. Only user-defined policies allowing "select", "style", and "option" elements are affected.

Permitting the "style" element in policies is hazardous, because bluemonday does not contain a CSS sanitizer. Newer versions of bluemonday suppress "style" and "script" elements even when allowed by a policy unless the policy explicitly requests unsafe processing.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. Rated impact: confidentiality high, integrity high, availability high.

Weakness class

CVE-2021-42576 is classified as CWE-20: Improper Input Validation. The application accepts input without checking that it has the expected form, so malformed values reach code that assumes they are well formed.

Affected software

CVE-2021-42576 is recorded against 2 packages.

  • github.com/microcosm-cc/bluemonday
  • pybluemonday (fixed in 0.0.8)

Timeline and source

Published on 19 October 2021 and last revised on 21 October 2024. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from OSV.

References

nvd.nist.gov (Advisory)
github.com (Web)
docs.google.com (Web)
github.com (Advisory)
github.com (Package)
github.com (Web)
pkg.go.dev (Web)
pypi.org (Web)

CVE-2021-42576 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U
CWE CWE-20
Public Exploit ✅ No
Source OSV
Published 2021-10-19
Updated 2026-08-12
Modified 2024-10-21

Affected Packages

Software From version Fixed in
github.com/microcosm-cc/bluemonday
pybluemonday 0.0.8

Site Security Check

Is pybluemonday part of your stack?

CVE-2021-42576 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.