This repository was archived by the owner on Jun 10, 2026. It is now read-only.
regular expression denial-of-service (ReDoS) in BleachSanitizerFilter.sanitize_css gauntlet regular expression
Package
bleach
(python)
Affected versions
<=3.1.3
Patched versions
3.1.4
Impact
bleach.cleanbehavior parsing style attributes could result in a regular expression denial of service (ReDoS).Calls to
bleach.cleanwith an allowed tag with an allowedstyleattribute are vulnerable to ReDoS. For example,bleach.clean(..., attributes={'a': ['style']}).Patches
3.1.4
Workarounds
do not whitelist the style attribute in
bleach.cleancallslimit input string length
References
Credits
For more information
If you have any questions or comments about this advisory: