CVE-2020-5236: Catastrophic backtracking in regex allows Denial of Service in Waitress
(updated )
When 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.
This would allow an attacker to send a single request with an invalid header and take the service offline.
Invalid header example:
Bad-header: xxxxxxxxxxxxxxx\x10
Increasing the number of x
’s in the header will increase the amount of time Waitress spends in the regular expression engine.
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.
References
- github.com/Pylons/waitress
- github.com/Pylons/waitress/commit/6e46f9e3f014d64dd7d1e258eaf626e39870ee1f
- github.com/Pylons/waitress/security/advisories/GHSA-73m2-3pwg-5fgc
- github.com/advisories/GHSA-73m2-3pwg-5fgc
- github.com/pypa/advisory-database/tree/main/vulns/waitress/PYSEC-2020-155.yaml
- nvd.nist.gov/vuln/detail/CVE-2020-5236
Detect and mitigate CVE-2020-5236 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →