CVE-2020-5236: Waitress Denial of Service Vulnerability
MODERATECVE-2020-5236 is a MODERATE (CVSS 5.7) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Waitress libraries in the PyPI ecosystem. The issue involves catastrophic backtracking in regex allows denial of service in waitress. Remediation is available by upgrading affected packages to version 1.4.3.
CVE-2020-5236 at a Glance
Security Impact
CVSS: 5.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H).
How to Fix CVE-2020-5236
To remediate this vulnerability, upgrade all affected Waitress dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install waitress>=1.4.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show waitress
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2020-5236, inspect your installed packages using pip:
pip show waitress
Analyze the terminal output to locate any version of Waitress in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.3), your application is affected.
Note: The pip show waitress command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Waitress, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-5236 Affected Waitress Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
waitress
|
PyPI |
≥ 1.4.2
< 1.4.3
All 1 versions
1.4.2
|
1.4.3
|
References
Frequently Asked Questions
What is CVE-2020-5236?
Which Waitress versions are affected?
What version fixes CVE-2020-5236?
Is waitress affected?
What is the CVSS score of CVE-2020-5236?
What CWE is associated with CVE-2020-5236?
How can I check PyPI dependencies for CVE-2020-5236?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-73m2-3pwg-5fgc",
"modified" : "2024-11-19T15:34:34Z",
"published" : "2020-02-04T03:07:31Z",
"aliases" : [ "CVE-2020-5236" ],
"summary" : "Catastrophic backtracking in regex allows Denial of Service in Waitress",
"details" : "### Impact\n\nWhen waitress receives a header that contains invalid characters it will cause the regular expression engine to catastrophically backtrack causing the process to use 100% CPU time and blocking any other interactions.\n\nThis would allow an attacker to send a single request with an invalid header and take the service offline.\n\nInvalid header example:\n\n```\nBad-header: xxxxxxxxxxxxxxx\\x10\n```\n\nIncreasing the number of `x`'s in the header will increase the amount of time Waitress spends in the regular expression engine.\n\nThis 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.\n\n### Patches\n\nThe 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.\n\n### Workarounds\n\nIf you have deployed a reverse proxy in front of Waitress it may already be rejecting requests that include invalid headers.\n\n### Thanks\n\nThe Pylons Project would like to thank [Fil Zembowicz](https://github.com/fzembow) for reaching out and disclosing this vulnerability!\n\n### References\n\nCatastrophic backtracking explained: https://www.regular-expressions.info/catastrophic.html\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n- open an issue at https://github.com/Pylons/waitress/issues (if not sensitive or security related)\n- email the Pylons Security mailing list: pylons-project-security@googlegroups.com (if security related)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "waitress"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.4.2"
}, {
"fixed" : "1.4.3"
} ]
} ],
"versions" : [ "1.4.2" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Pylons/waitress/security/advisories/GHSA-73m2-3pwg-5fgc"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-5236"
}, {
"type" : "WEB",
"url" : "https://github.com/Pylons/waitress/commit/6e46f9e3f014d64dd7d1e258eaf626e39870ee1f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Pylons/waitress"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/waitress/PYSEC-2020-155.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-02-04T03:06:40Z",
"nvd_published_at" : null
}
}