CVE-2023-46136: Werkzeug vulnerable to high resource usage when parsing multipart/form-data containing a large part with CR/LF character at the beginning

Published Oct 24, 2023
·
Updated

Pallets Werkzeug is vulnerable to a denial of service, caused by a flaw when parsing multipart/form-data containing a large part with CR/LF character at the beginning. By sending a specially crafted request, a remote authenticated attacker could exploit this vulnerability to cause a denial of service condition.

Other sources

Werkzeug is a comprehensive WSGI web application library. 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.

NVD

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.

MITRE

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.

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. If many concurrent requests are sent continuously, this can exhaust or kill all available workers.

GitHub

Affected Software

6 affected componentsFixes available
pip/werkzeug<2.3.8
2.3.8
pip/werkzeug>=3.0.0<3.0.1
3.0.1
palletsprojects Werkzeug<2.3.8
palletsprojects Werkzeug=3.0.0
redhat/python-werkzeug<3.0.1
3.0.1
IBM Concert Software<=1.0.0, 1.0.1, 1.0.2, 1.0.2.1

Event History

Oct 24, 2023
CVE Published
via MITRE·11:48 PM
Data Sourced
via MITRE·11:48 PM
DescriptionSeverityWeakness
Oct 25, 2023
Advisory Published
via GitHub·02:22 PM
Data Sourced
via NVD·06:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Oct 26, 2023
Data Sourced
via Red Hat·09:41 AM
DescriptionSeverityAffected Software
Oct 17, 2024
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2023-46136?

CVE-2023-46136 is a vulnerability in the Werkzeug library that allows for a file upload issue.

2

What is the impact of CVE-2023-46136?

The impact of CVE-2023-46136 is high, with a severity value of 8, as it allows for potential unauthorized access to uploaded files.

3

How does CVE-2023-46136 work?

CVE-2023-46136 occurs due to inefficient code in the Werkzeug multipart data parser, which allows for potential boundary parsing issues when uploading files beginning with CR or LF characters.

4

What is the affected software version of CVE-2023-46136?

The affected software version of CVE-2023-46136 is Werkzeug 3.0.0, with version 3.0.1 being the remedy.

5

How can I fix CVE-2023-46136?

To fix CVE-2023-46136, update Werkzeug to version 3.0.1 or higher.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203
CVE-2023-46136 - Werkzeug vulnerable to high resource usage when parsing multipart/form-data containing a large part with CR/LF character at the beginning - SecAlerts