CVE-2023-25577: Werkzeug Remote Code Execution Vulnerability
HIGHCVE-2023-25577 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Werkzeug libraries in the PyPI ecosystem. The issue involves high resource usage when parsing multipart form data with many fields. Remediation is available by upgrading affected packages to version 2.2.3.
CVE-2023-25577 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2023-25577
To remediate this vulnerability, upgrade all affected Werkzeug 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>=2.2.3
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-25577, inspect your installed packages using pip:
pip show Werkzeug
Analyze the terminal output to locate any version of Werkzeug in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.3), 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, 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-25577 Affected Werkzeug Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Werkzeug
|
PyPI |
< 2.2.3
|
2.2.3
|
References
Frequently Asked Questions
What is CVE-2023-25577?
Which Werkzeug versions are affected?
What version fixes CVE-2023-25577?
Is Werkzeug affected?
What is the CVSS score of CVE-2023-25577?
What CWE is associated with CVE-2023-25577?
How can I check PyPI dependencies for CVE-2023-25577?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xg9f-g7g7-2323",
"modified" : "2024-11-19T19:07:37Z",
"published" : "2023-02-15T15:36:26Z",
"aliases" : [ "CVE-2023-25577" ],
"summary" : "High resource usage when parsing multipart form data with many fields",
"details" : "Werkzeug's multipart form data parser will parse an unlimited number of parts, including file parts. Parts can be a small amount of bytes, but each requires CPU time to parse and may use more memory as Python data. If a request can be made to an endpoint that accesses `request.data`, `request.form`, `request.files`, or `request.get_data(parse_form_data=False)`, it can cause unexpectedly high resource usage.\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. Unlimited file parts can use up memory and file handles. If many concurrent requests are sent continuously, this can exhaust or kill all available workers.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "Werkzeug"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.2.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pallets/werkzeug/security/advisories/GHSA-xg9f-g7g7-2323"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-25577"
}, {
"type" : "WEB",
"url" : "https://github.com/pallets/werkzeug/commit/517cac5a804e8c4dc4ed038bb20dacd038e7a9f1"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pallets/werkzeug"
}, {
"type" : "WEB",
"url" : "https://github.com/pallets/werkzeug/releases/tag/2.2.3"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/werkzeug/PYSEC-2023-58.yaml"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20230818-0003"
}, {
"type" : "WEB",
"url" : "https://www.debian.org/security/2023/dsa-5470"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-770" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-02-15T15:36:26Z",
"nvd_published_at" : "2023-02-14T20:15:00Z"
}
}