CVE-2020-5236 Catastrophic backtracking in regex allows Denial of Service in Waitress
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.
| Package | Affected | Fixed in |
|---|---|---|
waitress PyPI | All versions | 1.4.3 |
waitress PyPI | From 1.4.2 | 1.4.3 |
waitress PyPI | From 1.4.2 | 1.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.
Other vulnerabilities in Pylons Waitress
- CVE-2024-49768 Waitress has request processing race condition in HTTP pipelining with invalid first request
- CVE-2024-49769 Waitress has a denial of service leading to high CPU usage/resource exhaustion
- CVE-2022-24761 HTTP Request Smuggling in waitress
- CVE-2019-16792 HTTP Request Smuggling: Content-Length Sent Twice in Waitress
- CVE-2019-16789 HTTP Request Smuggling in Waitress: Invalid whitespace characters in headers
Sources
Also known as GHSA-73m2-3pwg-5fgc, PYSEC-2020-155.