# 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.

- **Severity:** Low 3.4 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:N/A:N`)
- **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:** Yes
- **Published:** 14 Nov 2023
- **Updated:** 3 Nov 2025
- **Also known as:** AZL-43519, AZL-44538, DEBIAN-CVE-2023-47641, GHSA-xx9p-xxvh-7g8j, OESA-2023-1854, PYSEC-2023-247, SUSE-SU-2023:4909-1, UBUNTU-CVE-2023-47641

## 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 (Inconsistent Interpretation of HTTP Requests)

## Which versions are affected by CVE-2023-47641?

3 open source packages ship an affected version, including aiohttp. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `aiohttp` | PyPI | All versions | 3.8.0 |
| `aiohttp` | PyPI | All versions | 3.8.0 |
| `aiohttp` | PyPI | All versions | 3.8.0 |
| `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: 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](https://insights.sbomify.com/CVE-2024-52303/): aiohttp memory leak when middleware is enabled when requesting a resource with a non-allowed method (high 8.7)
- [CVE-2025-69223](https://insights.sbomify.com/CVE-2025-69223/): AIOHTTP's HTTP Parser auto_decompress feature is vulnerable to zip bomb (high 7.5)
- [CVE-2024-30251](https://insights.sbomify.com/CVE-2024-30251/): Denial of service when trying to parse malformed POST requests in aiohttp (high 7.5)
- [CVE-2023-49081](https://insights.sbomify.com/CVE-2023-49081/): aiohttp's ClientSession is vulnerable to CRLF injection via version (high 7.2)
- [CVE-2026-22815](https://insights.sbomify.com/CVE-2026-22815/): AIOHTTP: Uncapped memory usage possible through aiohttp allowing unlimited trailer headers (medium 6.9)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-47641 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2023-47641 in the wild and no public exploit code.

Affected packages and fixed versions:
- aiohttp (PyPI): affected all versions; fixed in 3.8.0
- aiohttp (PyPI): affected all versions; fixed in 3.8.0
- aiohttp (PyPI): affected all versions; fixed in 3.8.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-47641/ (Markdown: https://insights.sbomify.com/CVE-2023-47641/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-47641
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-47641
- OSV: https://osv.dev/vulnerability/CVE-2023-47641

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-47641/
Summaries are generated and may contain mistakes; the official description above is the record.
