CVE-2023-25577 Werkzeug may allow high resource usage when parsing multipart form data with many fields

High 7.5 Published Updated

An attacker can cause denial of service by sending crafted multipart data to endpoints parsing form data, exhausting CPU and memory resources.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-25577?

CVE-2023-25577 is a high-severity denial of service vulnerability in pallets werkzeug, published on 14 Feb 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Werkzeug is a comprehensive WSGI web application library. Prior to version 2.2.3, 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. 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. 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. Version 2.2.3 contains a patch for this issue.

Weakness: CWE-770

Which versions are affected by CVE-2023-25577?

3 open source packages ship an affected version, including werkzeug and Werkzeug. It affects 1 product.

PackageAffectedFixed in
werkzeug PyPIAll versions2.2.3
werkzeug PyPIAll versions2.2.3
Werkzeug PyPIAll versions2.2.3
Linux distribution packages (32)
python-werkzeug Red Hat:openshift_ironic:4.11::el8All versions0:2.0.3-5.el8
python3-werkzeug Red Hat:openshift_ironic:4.11::el8All versions0:2.0.3-5.el8
python-werkzeug Red Hat:openshift_ironic:4.12::el9All versions0:2.0.3-4.el9
python3-werkzeug Red Hat:openshift_ironic:4.12::el9All versions0:2.0.3-4.el9
python-werkzeug Red Hat:openstack:13::el7All versions0:0.14.1-3.1.el7ost
python2-werkzeug Red Hat:openstack:13::el7All versions0:0.14.1-3.1.el7ost
python2-werkzeug-doc Red Hat:openstack:13::el7All versions0:0.14.1-3.1.el7ost
python-werkzeug Red Hat:openstack:16.1::el8All versions0:0.14.1-12.el8ost
python3-werkzeug Red Hat:openstack:16.1::el8All versions0:0.14.1-12.el8ost
python-werkzeug Red Hat:openstack:16.2::el8All versions0:0.14.1-12.el8ost
python3-werkzeug Red Hat:openstack:16.2::el8All versions0:0.14.1-12.el8ost
python-Werkzeug SUSE:Enterprise Storage 7All versions0.14.1-150100.6.6.1
python-Werkzeug SUSE:Enterprise Storage 7.1All versions1.0.1-150300.3.3.1
python-Werkzeug SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSSAll versions0.14.1-150100.6.6.1
python-Werkzeug SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSSAll versions0.14.1-150100.6.6.1
python-Werkzeug SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOSAll versions1.0.1-150300.3.3.1
python-Werkzeug SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSSAll versions1.0.1-150300.3.3.1
python-Werkzeug SUSE:Linux Enterprise Module for Basesystem 15 SP4All versions1.0.1-150300.3.3.1
python-Werkzeug SUSE:Linux Enterprise Module for Package Hub 15 SP4All versions1.0.1-150300.3.3.1
python-Werkzeug SUSE:Linux Enterprise Module for Public Cloud 12All versions0.12.2-10.13.1
python-Werkzeug SUSE:Linux Enterprise Real Time 15 SP3All versions1.0.1-150300.3.3.1
python-Werkzeug SUSE:Linux Enterprise Server 15 SP1-LTSSAll versions0.14.1-150100.6.6.1
python-Werkzeug SUSE:Linux Enterprise Server 15 SP2-LTSSAll versions0.14.1-150100.6.6.1
python-Werkzeug SUSE:Linux Enterprise Server 15 SP3-LTSSAll versions1.0.1-150300.3.3.1
python-Werkzeug SUSE:Linux Enterprise Server for SAP Applications 15 SP1All versions0.14.1-150100.6.6.1
python-Werkzeug SUSE:Linux Enterprise Server for SAP Applications 15 SP2All versions0.14.1-150100.6.6.1
python-Werkzeug SUSE:Linux Enterprise Server for SAP Applications 15 SP3All versions1.0.1-150300.3.3.1
python-Werkzeug SUSE:Manager Proxy 4.2All versions1.0.1-150300.3.3.1
python-Werkzeug SUSE:Manager Server 4.2All versions1.0.1-150300.3.3.1
python-Werkzeug openSUSE:Leap 15.4All versions1.0.1-150300.3.3.1
python-Werkzeug-doc openSUSE:Leap 15.4All versions0.14.1-150100.6.6.1
python-Werkzeug openSUSE:TumbleweedAll versions2.2.3-1.1

Products include Palletsprojects Werkzeug.

How do I fix CVE-2023-25577?

Upgrade werkzeug to 2.2.3 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2023-25577 being exploited?

There is no known exploitation of CVE-2023-25577 in the wild and no public exploit code.

Sources

Also known as AZL-13588, DEBIAN-CVE-2023-25577, GHSA-xg9f-g7g7-2323, PYSEC-2023-58, RHBA-2023:1507, RHBA-2023:1759 and 7 more.

Is CVE-2023-25577 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free