NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · PyPI

CVE-2026-128127: AIOHTTP: Base64 multipart parts bypass client_max_size

highCVSS 4.0 8.7 · 3.1 7.5GHSA-24c4-3p7v-29cm

aiohttp 3.14.3 and earlier can be made to read a whole multipart body into memory, or spin the event loop, by a crafted base64 part. This bypasses client_max_size. Handlers that read multipart data are affected. Upgrade to aiohttp 3.14.4.

Published Nov 16, 2026 · Analysis Nov 16, 2026

What an attacker can do

BodyPartReader.read_chunk() handles multipart parts that use Content-Transfer-Encoding: base64. It kept reading until the chunk length was a multiple of 4, with no byte limit. A part with a short Content-Length, or a long run of whitespace, can make a single call read the entire remaining body into memory before any size check runs. It can also loop on the event loop.

The result is that client_max_size, the limit meant to bound request size, does not hold for these requests. An attacker needs only network access to an endpoint that reads multipart data, such as a file upload handler. No login is needed.

The effect is memory exhaustion or a blocked event loop, so the service becomes slow or is killed by the OOM killer. The flaw does not expose data or run code.

Who is affected

aiohttp <= 3.14.3, in applications with handlers that read multipart bodies, through request.multipart() and BodyPartReader. Apps with no multipart handler are not on this path. Check the installed version:

pip show aiohttp

Search your code for multipart readers:

grep -rn "multipart()" .

aiohttp

Ecosystem
PyPI
Affected
<= 3.14.3
Fixed in
3.14.4
Check
pip show aiohttp

How to fix it

Upgrade to aiohttp 3.14.4:

pip install --upgrade aiohttp==3.14.4

The advisory names no workaround. Until you can upgrade, a reverse proxy that caps the request body size before aiohttp sees it limits the memory an attacker can force. The advisory does not state this itself. Setting container memory limits also contains the damage.

How to tell if you were hit

Watch for sudden memory growth in worker processes, OOM kills and event loop stalls on services with upload endpoints. In access logs, look for multipart POST requests from the same source that preceded the spike. Requests with a base64 Content-Transfer-Encoding part header and a short or odd Content-Length are the pattern the advisory describes.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

When reading a multipart part with Content-Transfer-Encoding: base64, BodyPartReader.read_chunk() kept reading until the chunk length was a multiple of 4, with no byte limit. A part with a short Content-Length, or a long run of whitespace, could cause the entire remaining body to be read into memory within a single call before any size check, or spin on the event loop.

Impact

An attacker could bypass client_max_size to cause excessive memory use, or block the event loop, with a specially crafted multipart request to any handler that reads multipart data.

---

Patch: https://github.com/aio-libs/aiohttp/commit/a555ab698e08e9baea7386d5b4c0761cb8956fdd

Credited to afldl, Dreamsorcerer.

Questions

Why does client_max_size not stop this?

read_chunk() kept reading until the length was a multiple of 4, with no limit. A single call could pull the remaining body into memory before the size check ran.

Which version fixes CVE-2026-128127?

aiohttp 3.14.4. Versions through 3.14.3 are affected.

Is a login required?

No. The attacker only needs to send a crafted multipart request to any handler that reads multipart data.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More PyPI vulnerabilities

All PyPI entries