Skip to content

fix: set python-multipart minimum version to address CVE-2024-24762#6237

Open
maycuatroi1 wants to merge 1 commit intojina-ai:masterfrom
maycuatroi1:fix/cve-2024-24762-python-multipart-minimum-version
Open

fix: set python-multipart minimum version to address CVE-2024-24762#6237
maycuatroi1 wants to merge 1 commit intojina-ai:masterfrom
maycuatroi1:fix/cve-2024-24762-python-multipart-minimum-version

Conversation

@maycuatroi1
Copy link

What

Adds a minimum version constraint >=0.0.7 to python-multipart in both
extra-requirements.txt and jina/resources/extra-requirements.txt.

Why

python-multipart without a lower bound allows installing versions affected
by CVE-2024-24762 (CVSS 7.5, ReDoS).

The vulnerability is in parse_options_header(). When processing a
Content-Type header containing a crafted unclosed quoted-string boundary,
the internal regex (?:\\.|[^"])* enters catastrophic backtracking. Response
time grows exponentially with the number of backslash characters in the payload,
allowing an attacker to hang the server with a single HTTP request.

Measured behavior against python-multipart 0.0.6:

Backslashes in Content-Type Response time
10 2ms
30 348ms
40 >10s (hang)

The fix was released in version 0.0.7.

Change

- python-multipart:           standard,devel
+ python-multipart>=0.0.7:    standard,devel

Both extra-requirements.txt and jina/resources/extra-requirements.txt
are updated to keep them in sync.

Ref: GHSA-2jv5-9r88-3w3p

python-multipart without a lower bound allows installing versions
vulnerable to CVE-2024-24762 (CVSS 7.5, ReDoS).

The vulnerability is in parse_options_header(). A crafted Content-Type
header with an unclosed quoted-string boundary triggers catastrophic
backtracking in the internal regex (?:\\.|[^"])*. Response time grows
exponentially with payload length, allowing an attacker to hang the
server with a single HTTP request containing ~40 backslash characters.

Setting >=0.0.7 ensures the patched version is installed. Both
extra-requirements.txt and jina/resources/extra-requirements.txt
are updated to keep them in sync.

Ref: GHSA-2jv5-9r88-3w3p
@maycuatroi1 maycuatroi1 requested a review from hanxiao as a code owner February 27, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant