Every CVE Search/ Get API key

CVE-2026-53540

Python-Multipart: Negative Content-Length in parse_form buffers the entire body in memory

3.7 LowFix available

Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
Low

Exploit likelihood

0.34%Up 0.1 points since Jun 23, 2026
90%50%10%1%

What each source reports

CVE List Score used 3.7

Python-Multipart: Negative Content-Length in parse_form buffers the entire body in memory

Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.

Record
CVE-2026-53540
CVSS 3.1
3.7 LowCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Weakness
CWE-1284
Updated
2026-11-02
EUVDEUVD-2026-38325 3.7

Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.

Record
EUVD-2026-38325
CVSS 3.1
3.7 LowCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Updated
2026-11-02
GitHub AdvisoriesGHSA-v9pg-7xvm-68hf 3.7

python-multipart: Negative Content-Length in parse_form buffers the entire body in memory

Summary

parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks.

Details

parse_form() reads the input stream in chunks, never reading more than the remaining Content-Length at a time. The per-chunk size is computed as min(content_length - bytes_read, chunk_size). The header value was parsed to an integer without checking its sign, so a Content-Length of -1 made this expression negative, and input_stream.read(-1) reads until end of stream. The intended bounded, chunked read therefore collapsed into a single unbounded read of the whole stream. The amount read is still bounded by what the client actually sends.

Impact

This only affects code that calls parse_form() directly with a Content-Length header taken from attacker-controlled input and without normalizing a negative value first. No known package is affected:

  • Starlette and FastAPI drive MultipartParser directly from the ASGI receive() stream and do not call parse_form().
  • Known parse_form() consumers either do not forward Content-Length to it, recompute it from the already-read body, or run behind a layer (such as Werkzeug) that normalizes a negative Content-Length to 0.

The realistic exposure is limited to bespoke WSGI or http.server handlers that forward raw client headers into parse_form(). In that case a crafted request buffers the body in memory at once, degrading availability under concurrent requests rather than causing a complete denial of service.

Mitigation

Upgrade to version 0.0.31 or later, which rejects a negative Content-Length with a ValueError before reading the stream.

Record
GHSA-v9pg-7xvm-68hf
CVSS 3.1
3.7 LowCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Weakness
CWE-1284
Updated
2026-11-02
NVD 3.7

Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.

Record
CVE-2026-53540
CVSS 3.1
3.7 LowCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Weakness
CWE-1284
Updated
2026-11-02
OSV 3.7

Python-Multipart: Negative Content-Length in parse_form buffers the entire body in memory

Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.

Record
CVE-2026-53540
CVSS 3.1
3.7 LowCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Weakness
CWE-1284
Updated
2026-11-02
OSVDEBIAN-CVE-2026-53540 3.7

Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.

Record
DEBIAN-CVE-2026-53540
CVSS 3.1
3.7 LowCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Updated
2026-11-02
Show 7 moreShow less
OSVGHSA-v9pg-7xvm-68hf 3.7

python-multipart: Negative Content-Length in parse_form buffers the entire body in memory

Summary

parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks.

Details

parse_form() reads the input stream in chunks, never reading more than the remaining Content-Length at a time. The per-chunk size is computed as min(content_length - bytes_read, chunk_size). The header value was parsed to an integer without checking its sign, so a Content-Length of -1 made this expression negative, and input_stream.read(-1) reads until end of stream. The intended bounded, chunked read therefore collapsed into a single unbounded read of the whole stream. The amount read is still bounded by what the client actually sends.

Impact

This only affects code that calls parse_form() directly with a Content-Length header taken from attacker-controlled input and without normalizing a negative value first. No known package is affected:

  • Starlette and FastAPI drive MultipartParser directly from the ASGI receive() stream and do not call parse_form().
  • Known parse_form() consumers either do not forward Content-Length to it, recompute it from the already-read body, or run behind a layer (such as Werkzeug) that normalizes a negative Content-Length to 0.

The realistic exposure is limited to bespoke WSGI or http.server handlers that forward raw client headers into parse_form(). In that case a crafted request buffers the body in memory at once, degrading availability under concurrent requests rather than causing a complete denial of service.

Mitigation

Upgrade to version 0.0.31 or later, which rejects a negative Content-Length with a ValueError before reading the stream.

Record
GHSA-v9pg-7xvm-68hf
CVSS 3.1
3.7 LowCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Weakness
CWE-1284
Updated
2026-11-02
OSVPYSEC-2026-3040 3.7

python-multipart: Negative Content-Length in parse_form buffers the entire body in memory

Summary

parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks.

Details

parse_form() reads the input stream in chunks, never reading more than the remaining Content-Length at a time. The per-chunk size is computed as min(content_length - bytes_read, chunk_size). The header value was parsed to an integer without checking its sign, so a Content-Length of -1 made this expression negative, and input_stream.read(-1) reads until end of stream. The intended bounded, chunked read therefore collapsed into a single unbounded read of the whole stream. The amount read is still bounded by what the client actually sends.

Impact

This only affects code that calls parse_form() directly with a Content-Length header taken from attacker-controlled input and without normalizing a negative value first. No known package is affected:

  • Starlette and FastAPI drive MultipartParser directly from the ASGI receive() stream and do not call parse_form().
  • Known parse_form() consumers either do not forward Content-Length to it, recompute it from the already-read body, or run behind a layer (such as Werkzeug) that normalizes a negative Content-Length to 0.

The realistic exposure is limited to bespoke WSGI or http.server handlers that forward raw client headers into parse_form(). In that case a crafted request buffers the body in memory at once, degrading availability under concurrent requests rather than causing a complete denial of service.

Mitigation

Upgrade to version 0.0.31 or later, which rejects a negative Content-Length with a ValueError before reading the stream.

Record
PYSEC-2026-3040
CVSS 3.1
3.7 LowCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Updated
2026-11-02
OSVUBUNTU-CVE-2026-53540 3.7

Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.

Record
UBUNTU-CVE-2026-53540
CVSS 3.1
3.7 LowCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Updated
2026-11-02
OSVCLSA-2026-1782781170 No score

TuxCare security update for python-multipart (1 CVE)

TuxCare rebuilt python-multipart to address 1 CVE. Fixed in 0.0.6.post4+tuxcare.

Record
CLSA-2026-1782781170
Updated
2026-11-02
OSVopenSUSE-SU-2026:11099-1 No score

python311-python-multipart-0.0.32-1.1 on GA media

These are all security issues fixed in the python311-python-multipart-0.0.32-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:11099-1
Updated
2026-11-02
OSVopenSUSE-SU-2026:21066-1 No score

Security update for python-python-multipart

This update for python-python-multipart fixes the following issues

  • CVE-2026-53537: multipart/form-data with extended parameters can lead to file or parameter smuggling (bsc#1268506).
  • CVE-2026-53538: urlencoded requests containing semicolons can lead to form field smuggling (bsc#1268496).
  • CVE-2026-53539: small crafted body can cause a denial of service (bsc#1268500).
  • CVE-2026-53540: crafted request buffers can lead to degrading availability (bsc#1268488).
Record
openSUSE-SU-2026:21066-1
Updated
2026-11-02
OSVSUSE-SU-2026:22372-1 No score

Security update for python-python-multipart

This update for python-python-multipart fixes the following issues

  • CVE-2026-53537: multipart/form-data with extended parameters can lead to file or parameter smuggling (bsc#1268506).
  • CVE-2026-53538: urlencoded requests containing semicolons can lead to form field smuggling (bsc#1268496).
  • CVE-2026-53539: small crafted body can cause a denial of service (bsc#1268500).
  • CVE-2026-53540: crafted request buffers can lead to degrading availability (bsc#1268488).
Record
SUSE-SU-2026:22372-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
python-multipart
PyPI
before 0.0.31
0.0.31
python-multipart
TuxCare:PyPI
0.0.6 up to 0.0.6.post4+tuxcare, plus listed versions
0.0.6.post1+tuxcare0.0.6.post2+tuxcare0.0.6.post3+tuxcare
0.0.6.post4+tuxcare
python-multipart
Debian:12
All versions, plus listed versions
0.0.17-10.0.17-20.0.17-30.0.17-40.0.17-5
Show 9 moreShow less
0.0.20-10.0.20-1.10.0.20-1.1~deb13u10.0.22-10.0.26-10.0.32-10.0.5-30.0.6-10.0.9-1
None known
python-multipart
Debian:13
All versions, plus listed versions
0.0.20-10.0.20-1.10.0.20-1.1~deb13u10.0.22-10.0.26-10.0.32-1
None known
python-multipart
Debian:14
before 0.0.32-1, plus listed versions
0.0.20-10.0.20-1.10.0.20-1.1~deb13u10.0.22-10.0.26-1
0.0.32-1
python-multipart
PyPI
before 0.0.31, plus listed versions
0.0.10.0.100.0.110.0.120.0.13
Show 25 moreShow less
0.0.140.0.150.0.160.0.170.0.180.0.190.0.20.0.200.0.210.0.220.0.230.0.240.0.250.0.260.0.270.0.280.0.290.0.30.0.300.0.40.0.50.0.60.0.70.0.80.0.9
0.0.31
python-python-multipart
SUSE:Linux Enterprise Server 16.0
From an advisory covering 4 CVEs
before 0.0.20-160000.5.1
0.0.20-160000.5.1
python-python-multipart
SUSE:Linux Enterprise Server for SAP applications 16.0
From an advisory covering 4 CVEs
before 0.0.20-160000.5.1
0.0.20-160000.5.1
python-multipart
Ubuntu:Pro:22.04:LTS
All versions, plus listed versions
0.0.5-20.0.5-2ubuntu0.1~esm1
None known
python-multipart
Ubuntu:Pro:24.04:LTS
All versions, plus listed versions
0.0.5-30.0.6-10.0.9-10.0.9-1ubuntu0.1~esm1
None known
Show 5 moreShow less
Affected packages
PackageAffectedFixed
python-multipart
Ubuntu:25.10
All versions, plus listed versions
0.0.20-1
None known
python-multipart
Ubuntu:26.10
All versions, plus listed versions
0.0.20-1.10.0.26-10.0.32-1
None known
python-multipart
Ubuntu:26.04:LTS
All versions, plus listed versions
0.0.20-10.0.20-1.1
None known
python-python-multipart
openSUSE:Tumbleweed
From an advisory covering 3 CVEs
before 0.0.32-1.1
0.0.32-1.1
python-python-multipart
openSUSE:Leap 16.0
From an advisory covering 4 CVEs
before 0.0.20-160000.5.1
0.0.20-160000.5.1

History

History
RecordedChangedSources
affected, facts
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-53540 is a low vulnerability (CVSS 3.7) in Fastapiexpert Python-multipart, published June 15, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.34%, the 27th percentile. Fixed in python-multipart 0.0.31.

References

Show 12 moreShow less
MoveEnter Open