CVE-2020-5236 Catastrophic backtracking in regex allows Denial of Service in Waitress

Medium 5.7 Published Updated

An attacker can cause a denial of service in Waitress by sending a request with an invalid header, triggering catastrophic regex backtracking and consuming all CPU resources.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2020-5236?

CVE-2020-5236 is a medium-severity denial of service vulnerability in Pylons Waitress, published on 4 Feb 2020. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

Waitress version 1.4.2 allows a DOS attack When waitress receives a header that contains invalid characters. When a header like "Bad-header: xxxxxxxxxxxxxxx\x10" is received, it will cause the regular expression engine to catastrophically backtrack causing the process to use 100% CPU time and blocking any other interactions. This allows an attacker to send a single request with an invalid header and take the service offline. This issue was introduced in version 1.4.2 when the regular expression was updated to attempt to match the behaviour required by errata associated with RFC7230. The regular expression that is used to validate incoming headers has been updated in version 1.4.3, it is recommended that people upgrade to the new version of Waitress as soon as possible.

Weakness: CWE-400

Which versions are affected by CVE-2020-5236?

3 open source packages ship an affected version, including waitress. It affects 1 product.

PackageAffectedFixed in
waitress PyPIAll versions1.4.3
waitress PyPIFrom 1.4.21.4.3
waitress PyPIFrom 1.4.21.4.3

Products include Agendaless Waitress.

How do I fix CVE-2020-5236?

Upgrade waitress to 1.4.3 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2020-5236 being exploited?

There is no known exploitation of CVE-2020-5236 in the wild and no public exploit code.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as GHSA-73m2-3pwg-5fgc, PYSEC-2020-155.

Is CVE-2020-5236 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free