Lucene search

K
githubGitHub Advisory DatabaseGHSA-HRFV-MQP8-Q5RW
HistoryOct 25, 2023 - 2:22 p.m.

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

2023-10-2514:22:59
CWE-400
CWE-787
GitHub Advisory Database
github.com
31
werkzeug
dos
resource usage
multipart
form-data
cr/lf
boundary
parser
denial of service
cpu
ram
concurrent requests.

8 High

CVSS3

Attack Vector

ADJACENT

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

0.001 Low

EPSS

Percentile

21.3%

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 configurations

Vulners
Node
palletsprojectswerkzeugRange<2.3.8
OR
palletsprojectswerkzeugRange<3.0.1
CPENameOperatorVersion
werkzeuglt2.3.8
werkzeuglt3.0.1

8 High

CVSS3

Attack Vector

ADJACENT

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

0.001 Low

EPSS

Percentile

21.3%