You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
regular expression denial-of-service (ReDoS) in Bleach
High severity
GitHub Reviewed
Published
Mar 26, 2020
in
mozilla/bleach
•
Updated Sep 6, 2024
bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS).
Calls to bleach.clean with an allowed tag with an allowed style attribute are vulnerable to ReDoS. For example, bleach.clean(..., attributes={'a': ['style']}).
Patches
3.1.4
Workarounds
do not whitelist the style attribute in bleach.clean calls
The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
Learn more on MITRE.
The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles.
Learn more on MITRE.
Impact
bleach.clean
behavior parsing style attributes could result in a regular expression denial of service (ReDoS).Calls to
bleach.clean
with an allowed tag with an allowedstyle
attribute are vulnerable to ReDoS. For example,bleach.clean(..., attributes={'a': ['style']})
.Patches
3.1.4
Workarounds
do not whitelist the style attribute in
bleach.clean
callslimit input string length
References
Credits
For more information
If you have any questions or comments about this advisory:
References