CVE-2023-47641
python-aiohttp: inconsistent interpretation of `Content-Length` vs. `Transfer-Encoding`
Overview
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.
Source: OX vulnerability database
Severity
6.5 · MEDIUM
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Weakness: CWE-444
Affected packages · 3
| Ecosystem | Package | Vulnerable | Fixed in |
|---|---|---|---|
| PyPI | aiohttp | <3.8.0 | 3.8.0 |
| Seal PyPI | aiohttp | >=2.3.9+sp0, <2.3.9+sp999>=3.0.8+sp0, <3.0.8+sp999 | 2.3.9+sp9993.0.8+sp999 |
| Seal PyPI | seal-aiohttp | >=2.3.9+sp1, <2.3.9+sp999>=3.0.8+sp1, <3.0.8+sp999 | 2.3.9+sp9993.0.8+sp999 |
Open a package to see all its vulnerabilities.
Operating systems · 12 fixes
SUSE Linux Enterprise 2 releases · 2 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 15.4 | python3-aiohttp | 3.6.0-150100.3.12.1 | SUSE-SU-2023:4909-1 |
| 15.4 | python311-aiohttp | 3.9.3-150400.10.14.1 | SUSE-SU-2024:0577-1 |
| 15.5 | python3-aiohttp | 3.6.0-150100.3.12.1 | SUSE-SU-2023:4909-1 |
| 15.5 | python311-aiohttp | 3.9.3-150400.10.14.1 | SUSE-SU-2024:0577-1 |
debian 5 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 10 | python-aiohttp | affected |
| 11 | python-aiohttp | 3.7.4-1+deb11u1 |
| 12 | python-aiohttp | 3.8.1-1 |
| 13 | python-aiohttp | 3.8.1-1 |
| 14 | python-aiohttp | 3.8.1-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| python-aiohttp | 3.8.1-1 |
openSUSE 1 release · 2 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Tumbleweed | python313-aiohttp +1 | 3.14.3-1.1 | openSUSE-SU-2026:11467-1 |
| Tumbleweed | python310-aiohttp +3 | 3.9.3-2.1 | openSUSE-SU-2024:13691-1 |
References
- access.redhat.com https://access.redhat.com/security/cve/CVE-2023-47641
- github.com https://github.com/aio-libs/aiohttp
- github.com https://github.com/aio-libs/aiohttp/commit/f016f0680e4ace6742b03a70cb0382ce86abe371
- github.com https://github.com/aio-libs/aiohttp/releases/tag/v3.8.0
- github.com https://github.com/aio-libs/aiohttp/security/advisories/GHSA-xx9p-xxvh-7g8j
- github.com https://github.com/pypa/advisory-database/tree/main/vulns/aiohttp/PYSEC-2023-247.yaml
- lists.debian.org https://lists.debian.org/debian-lts-announce/2025/02/msg00002.html
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2023-47641
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2023-47641
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.