CVE-2023-47641 Inconsistent interpretation of `Content-Length` vs. `Transfer-Encoding` in aiohttp
Attackers can bypass proxy rules and poison sockets via inconsistent HTTP header interpretation in aiohttp when used behind a reverse proxy.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2023-47641?
CVE-2023-47641 is a low-severity vulnerability in aio-libs aiohttp, published on 14 Nov 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. Affected versions of aiohttp have a security vulnerability regarding the inconsistent interpretation of the http protocol. HTTP/1.1 is a persistent protocol, if both Content-Length(CL) and Transfer-Encoding(TE) header values are present it can lead to incorrect interpretation of two entities that parse the HTTP and we can poison other sockets with this incorrect interpretation. A possible Proof-of-Concept (POC) would be a configuration with a reverse proxy(frontend) that accepts both CL and TE headers and aiohttp as backend. As aiohttp parses anything with chunked, we can pass a chunked123 as TE, the frontend entity will ignore this header and will parse Content-Length. The impact of this vulnerability is that it is possible to bypass any proxy rule, poisoning sockets to other users like passing Authentication Headers, also if it is present an Open Redirect an attacker could combine it to redirect random users to another website and log the request. This vulnerability has been addressed in release 3.8.0 of aiohttp. Users are advised to upgrade. There are no known workarounds for this vulnerability.
Weakness: CWE-444
Which versions are affected by CVE-2023-47641?
3 open source packages ship an affected version, including aiohttp. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
aiohttp PyPI | All versions | 3.8.0 |
aiohttp PyPI | All versions | 3.8.0 |
aiohttp PyPI | All versions | 3.8.0 |
Linux distribution packages (7)
python-aiohttp SUSE:Linux Enterprise Module for Public Cloud 15 SP1 | All versions | 3.6.0-150100.3.12.1 |
python-aiohttp SUSE:Linux Enterprise Module for Public Cloud 15 SP2 | All versions | 3.6.0-150100.3.12.1 |
python-aiohttp SUSE:Linux Enterprise Module for Public Cloud 15 SP3 | All versions | 3.6.0-150100.3.12.1 |
python-aiohttp SUSE:Linux Enterprise Module for Public Cloud 15 SP4 | All versions | 3.6.0-150100.3.12.1 |
python-aiohttp SUSE:Linux Enterprise Module for Public Cloud 15 SP5 | All versions | 3.6.0-150100.3.12.1 |
python-aiohttp openSUSE:Leap 15.4 | All versions | 3.6.0-150100.3.12.1 |
python-aiohttp openSUSE:Leap 15.5 | All versions | 3.6.0-150100.3.12.1 |
Products include Aiohttp Aiohttp.
How do I fix CVE-2023-47641?
Upgrade aiohttp to 3.8.0 or later.
Is CVE-2023-47641 being exploited?
There is no known exploitation of CVE-2023-47641 in the wild and no public exploit code.
Other vulnerabilities in aio-libs aiohttp
- CVE-2024-52303 aiohttp memory leak when middleware is enabled when requesting a resource with a non-allowed method
- CVE-2025-69223 AIOHTTP's HTTP Parser auto_decompress feature is vulnerable to zip bomb
- CVE-2024-30251 Denial of service when trying to parse malformed POST requests in aiohttp
- CVE-2023-49081 aiohttp's ClientSession is vulnerable to CRLF injection via version
- CVE-2026-22815 AIOHTTP: Uncapped memory usage possible through aiohttp allowing unlimited trailer headers
Sources
Also known as AZL-43519, AZL-44538, DEBIAN-CVE-2023-47641, GHSA-xx9p-xxvh-7g8j, OESA-2023-1854, PYSEC-2023-247 and 2 more.