CVE-2023-46136: Werkzeug DoS Remote Code Execution Vulnerability
MODERATECVE-2023-46136 is a MODERATE (CVSS 5.7) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Werkzeug DoS libraries in the PyPI ecosystem. The issue involves high resource usage when parsing multipart/form-data containing a large part with cr/lf character at the beginning. Remediation is available by upgrading affected packages to version 3.0.1, 2.3.8.
CVE-2023-46136 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:A/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2023-46136
To remediate this vulnerability, upgrade all affected Werkzeug DoS 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 Werkzeug>=3.0.1
pip install Werkzeug>=2.3.8
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show Werkzeug
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2023-46136, inspect your installed packages using pip:
pip show Werkzeug
Analyze the terminal output to locate any version of Werkzeug DoS in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.1), your application is affected.
Note: The pip show Werkzeug 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 Werkzeug DoS, 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-2023-46136 Affected Werkzeug DoS Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Werkzeug
|
PyPI |
≥ 3.0.0
< 3.0.1
|
3.0.1
|
|
Werkzeug
|
PyPI |
≥ 2.0.0rc1
< 2.3.8
|
2.3.8
|
References
Frequently Asked Questions
What is CVE-2023-46136?
Which Werkzeug DoS versions are affected?
What version fixes CVE-2023-46136?
Is Werkzeug affected?
What is the CVSS score of CVE-2023-46136?
What CWE is associated with CVE-2023-46136?
How can I check PyPI dependencies for CVE-2023-46136?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hrfv-mqp8-q5rw",
"modified" : "2026-05-20T22:21:18Z",
"published" : "2023-10-25T14:22:59Z",
"aliases" : [ "CVE-2023-46136" ],
"summary" : "Werkzeug DoS: High resource usage when parsing multipart/form-data containing a large part with CR/LF character at the beginning",
"details" : "Werkzeug multipart data parser needs to find a boundary that may be between consecutive chunks. That's why parsing is based on looking for newline characters. Unfortunately, code looking for partial boundary in the buffer is written inefficiently, so if we upload 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.\n\nThis 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. The amount of RAM required can trigger an out of memory kill of the process. If many concurrent requests are sent continuously, this can exhaust or kill all available workers.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "Werkzeug"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.0.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "Werkzeug"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0rc1"
}, {
"fixed" : "2.3.8"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pallets/werkzeug/security/advisories/GHSA-hrfv-mqp8-q5rw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-46136"
}, {
"type" : "WEB",
"url" : "https://github.com/pallets/werkzeug/commit/b1916c0c083e0be1c9d887ee2f3d696922bfc5c1"
}, {
"type" : "WEB",
"url" : "https://github.com/pallets/werkzeug/commit/cbb446fdcada7685fce936ded01b76c08dbd6eb5"
}, {
"type" : "WEB",
"url" : "https://github.com/pallets/werkzeug/commit/f2300208d5e2a5076cbbb4c2aad71096fd040ef9"
}, {
"type" : "WEB",
"url" : "https://github.com/pallets/werkzeug/commit/f3c803b3ade485a45f12b6d6617595350c0f03e2"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pallets/werkzeug"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/werkzeug/PYSEC-2023-221.yaml"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20231124-0008"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-787" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-10-25T14:22:59Z",
"nvd_published_at" : "2023-10-25T18:17:36Z"
}
}