Vulnerability · Published Oct 24, 2023 · Assigned by GitHub_M
CVE-2023-46136Werkzeug vulnerable to high resource usage when parsing multipart/form-data containing a large part with CR/LF character at the beginning
High 8.0
In plain English
A high-severity uncontrolled resource consumption in werkzeug from pallets. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.3% (higher than 70% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official description
Werkzeug is a comprehensive WSGI web application library. In versions on the 3.x branch prior to 3.0.1 and on the 2.x branch prior to 2.3.8, if an upload of a file that starts with CR or LF and then is followed by megabytes of data without these characters: all of these bytes are appended chunk by chunk into internal bytearray and lookup for boundary is performed on growing buffer. This allows an attacker to cause a denial of service by sending crafted multipart data to an endpoint that will parse it. The amount of CPU time required can block worker processes from handling legitimate requests. This vulnerability has been patched in version 3.0.1 and 2.3.8.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | py3-werkzeug | 2.3.7-r0 | ALPINE-CVE-2023-46136 |
| Alpine:v3.21 | py3-werkzeug | 2.3.7-r0 | ALPINE-CVE-2023-46136 |
| Alpine:v3.22 | py3-werkzeug | 2.3.7-r0 | ALPINE-CVE-2023-46136 |
| Alpine:v3.23 | py3-werkzeug | 2.3.7-r0 | ALPINE-CVE-2023-46136 |
| Alpine:v3.24 | py3-werkzeug | 2.3.7-r0 | ALPINE-CVE-2023-46136 |
| Debian:12 | python-werkzeug | 2.2.2-3+deb12u1 | DEBIAN-CVE-2023-46136 |
| Debian:13 | python-werkzeug | 3.0.1-2 | DEBIAN-CVE-2023-46136 |
| Debian:14 | python-werkzeug | 3.0.1-2 | DEBIAN-CVE-2023-46136 |
| PyPI | werkzeug | 2.3.8, 3.0.1 | PYSEC-2023-221 |
| PyPI | werkzeug | 2.3.8 | GHSA-hrfv-mqp8-q5rw |
| PyPI | werkzeug | 3.0.1 | GHSA-hrfv-mqp8-q5rw |
Affected products (as reported)
Weakness: CWE-407, CWE-400 · Vector: CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H