CVE-2023-47641: Aiohttp Aiohttp Has Inconsistent Interpretation Of Vulnerability

LOW
Advisory Identifier: GHSA-xx9p-xxvh-7g8j
CVSS 3.4
CWE-444
Published
Advisory Summary

CVE-2023-47641 is a LOW (CVSS 3.4) aiohttp has inconsistent interpretation of vulnerability (CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) affecting Aiohttp libraries in the PyPI ecosystem. The issue involves aiohttp has inconsistent interpretation of `content-length` vs. `transfer-encoding` differing in c and python fallbacks. Remediation is available by upgrading affected packages to version 3.8.0.

CVE-2023-47641 at a Glance

CVE Identifier CVE-2023-47641
GHSA Identifier GHSA-xx9p-xxvh-7g8j
Severity LOW
CVSS v3.1 Base Score 3.4
CWE Classification CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
Affected Product Aiohttp
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2023-47641

To remediate this vulnerability, upgrade all affected Aiohttp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

aiohttp fixed: 3.8.0
pip install aiohttp>=3.8.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show aiohttp

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2023-47641, inspect your installed packages using pip:

pip show aiohttp

Analyze the terminal output to locate any version of Aiohttp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.8.0), your application is affected.

Note: The pip show aiohttp command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling'), where the product acts as an intermediary http agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed http requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination. In Aiohttp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Aiohttp has a security vulnerability regarding the inconsistent interpretation of the http protocol. As we know that HTTP/1.1 is persistent, if we have both Content-Length(CL) and Transfer-Encoding(TE) 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. I can give a Dockerfile with the configuration if you want. 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 (just like CVE-2021-21330) we can combine it to redirect random users to our website and log the request. ### References - https://github.com/aio-libs/aiohttp/commit/f016f0680e4ace6742b03a70cb0382ce86abe371

CVE-2023-47641 Affected Aiohttp Versions

1 component(s)
Fixed Versions:
3.8.0
Product / Package Ecosystem Affected Versions Fixed Version
aiohttp
PyPI
< 3.8.0
3.8.0

References

Frequently Asked Questions

What is CVE-2023-47641?
CVE-2023-47641 is a security vulnerability in Aiohttp involving Aiohttp has inconsistent interpretation of `Content-Length` vs. `Transfer-Encoding` differing in C and Python fallbacks under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling').
Which Aiohttp versions are affected?
Affected versions include releases prior to 3.8.0 across affected packages: aiohttp.
What version fixes CVE-2023-47641?
Upgrading to 3.8.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is aiohttp affected?
Yes, aiohttp is affected in releases prior to 3.8.0. Upgrade your dependency to 3.8.0 or later.
What is the CVSS score of CVE-2023-47641?
CVE-2023-47641 has a CVSS v3.1 base score of 3.4 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:N/A:N.
What CWE is associated with CVE-2023-47641?
CVE-2023-47641 is classified under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') (The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed HTTP requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination.).
How can I check PyPI dependencies for CVE-2023-47641?
Run the dependency tree command: 'pip show aiohttp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xx9p-xxvh-7g8j",
  "modified" : "2025-11-03T22:31:34Z",
  "published" : "2023-11-14T20:36:25Z",
  "aliases" : [ "CVE-2023-47641" ],
  "summary" : "Aiohttp has inconsistent interpretation of `Content-Length` vs. `Transfer-Encoding` differing in C and Python fallbacks",
  "details" : "### Impact\n\nAiohttp has a security vulnerability regarding the inconsistent interpretation of the http protocol. As we know that HTTP/1.1 is persistent, if we have both Content-Length(CL) and Transfer-Encoding(TE) it can lead to incorrect interpretation of two entities that parse the HTTP and we can poison other sockets with this incorrect interpretation.\n\nA 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. I can give a Dockerfile with the configuration if you want.\n\nThe 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 (just like CVE-2021-21330) we can combine it to redirect random users to our website and log the request.\n\n\n### References\n\n- https://github.com/aio-libs/aiohttp/commit/f016f0680e4ace6742b03a70cb0382ce86abe371",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "aiohttp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.8.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/aio-libs/aiohttp/security/advisories/GHSA-xx9p-xxvh-7g8j"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-47641"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aio-libs/aiohttp/commit/f016f0680e4ace6742b03a70cb0382ce86abe371"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/aio-libs/aiohttp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aio-libs/aiohttp/releases/tag/v3.8.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/aiohttp/PYSEC-2023-247.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2025/02/msg00002.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-444" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-11-14T20:36:25Z",
    "nvd_published_at" : "2023-11-14T21:15:13Z"
  }
}