CVE-2023-47641 Inconsistent interpretation of `Content-Length` vs. `Transfer-Encoding` in aiohttp

Low 3.4 Published Updated

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.

PackageAffectedFixed in
aiohttp PyPIAll versions3.8.0
aiohttp PyPIAll versions3.8.0
aiohttp PyPIAll versions3.8.0
Linux distribution packages (7)
python-aiohttp SUSE:Linux Enterprise Module for Public Cloud 15 SP1All versions3.6.0-150100.3.12.1
python-aiohttp SUSE:Linux Enterprise Module for Public Cloud 15 SP2All versions3.6.0-150100.3.12.1
python-aiohttp SUSE:Linux Enterprise Module for Public Cloud 15 SP3All versions3.6.0-150100.3.12.1
python-aiohttp SUSE:Linux Enterprise Module for Public Cloud 15 SP4All versions3.6.0-150100.3.12.1
python-aiohttp SUSE:Linux Enterprise Module for Public Cloud 15 SP5All versions3.6.0-150100.3.12.1
python-aiohttp openSUSE:Leap 15.4All versions3.6.0-150100.3.12.1
python-aiohttp openSUSE:Leap 15.5All versions3.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.

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.

Is CVE-2023-47641 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free