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.

Severity (CVSS 3.1)8.0High
Exploit odds (30 days)1.3%top 29.7% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack tooling1Public PoC

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

EcosystemPackageFixed inAdvisory
Alpine:v3.20py3-werkzeug2.3.7-r0ALPINE-CVE-2023-46136
Alpine:v3.21py3-werkzeug2.3.7-r0ALPINE-CVE-2023-46136
Alpine:v3.22py3-werkzeug2.3.7-r0ALPINE-CVE-2023-46136
Alpine:v3.23py3-werkzeug2.3.7-r0ALPINE-CVE-2023-46136
Alpine:v3.24py3-werkzeug2.3.7-r0ALPINE-CVE-2023-46136
Debian:12python-werkzeug2.2.2-3+deb12u1DEBIAN-CVE-2023-46136
Debian:13python-werkzeug3.0.1-2DEBIAN-CVE-2023-46136
Debian:14python-werkzeug3.0.1-2DEBIAN-CVE-2023-46136
PyPIwerkzeug2.3.8, 3.0.1PYSEC-2023-221
PyPIwerkzeug2.3.8GHSA-hrfv-mqp8-q5rw
PyPIwerkzeug3.0.1GHSA-hrfv-mqp8-q5rw

Affected products (as reported)

VendorProductVersions
pallets werkzeug >= 3.0.0, < 3.0.1>= 2.0.0rc1, < 2.3.8

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

References