Medium

Werkzeug DoS: High resource usage when parsing multipart/form-data containing a large part with CR/LF character at the beginning

  • Disclosed: 25.10.2023
  • Updated: 11.10.2026 15:17

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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) werkzeug >= 3.0.0, < 3.0.1, >= 2.0.0rc1, < 2.3.8 3.0.1, 2.3.8

References

CVSS score 5.7/10
CVSS vector
CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Weakness (CWE)
CWE-400, CWE-787
Platform
Python (PyPI)
Package
werkzeug
Disclosed
25.10.2023
Updated
11.10.2026 15:17

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2023-221 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-hrfv-mqp8-q5rw - CC BY 4.0

Vulnerability history: werkzeug

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (15) in the archive
Total entries
15
First → latest
10.2017 10.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 4
  • Medium 9
  • Low 1
  • Unrated 1

Disclosures per year

  1. 2017: 1
  2. 2018: 0
  3. 2019: 1
  4. 2020: 1
  5. 2021: 0
  6. 2022: 2
  7. 2023: 3
  8. 2024: 3
  9. 2025: 1
  10. 2026: 3
Severity:
  1. Werkzeug DoS: High resource usage when parsing multipart/form-data containing a large part with CR/LF character at the beginning this entry
    Medium · 5.7 CVE-2023-46136 >= 3.0.0, < 3.0.1, >= 2.0.0rc1, < 2.3.8 3.0.1, 2.3.8
  2. High · 7.5 CVE-2019-14322 < 0.15.5 0.15.5
  3. High · 7.5 CVE-2019-14806 < 0.15.3 0.15.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.