CVE-2023-37276: aiohttp vulnerable to HTTP request smuggling

Published Jul 19, 2023
·
Updated

Impact

aiohttp v3.8.4 and earlier are bundled with llhttp v6.0.6 which is vulnerable to CVE-2023-30589. The vulnerable code is used by aiohttp for its HTTP request parser when available which is the default case when installing from a wheel.

This vulnerability only affects users of aiohttp as an HTTP server (ie aiohttp.Application), you are not affected by this vulnerability if you are using aiohttp as an HTTP client library (ie aiohttp.ClientSession).

Reproducer

python from aiohttp import web

async def example(request: web.Request): headers = dict(request.headers) body = await request.content.read() return web.Response(text=f"headers: {headers} body: {body}")

app = web.Application() app.addroutes([web.post('/', example)]) web.runapp(app)

Sending a crafted HTTP request will cause the server to misinterpret one of the HTTP header values leading to HTTP request smuggling.

console $ printf "POST / HTTP/1.1\r\nHost: localhost:8080\r\nX-Abc: \rxTransfer-Encoding: chunked\r\n\r\n1\r\nA\r\n0\r\n\r\n" \ | nc localhost 8080

Expected output: headers: {'Host': 'localhost:8080', 'X-Abc': '\rxTransfer-Encoding: chunked'} body: b''

Actual output (note that 'Transfer-Encoding: chunked' is an HTTP header now and body is treated differently) headers: {'Host': 'localhost:8080', 'X-Abc': '', 'Transfer-Encoding': 'chunked'} body: b'A'

Patches

Upgrade to the latest version of aiohttp to resolve this vulnerability. It has been fixed in v3.8.5: pip install aiohttp >= 3.8.5

Workarounds

If you aren't able to upgrade you can reinstall aiohttp using AIOHTTPNOEXTENSIONS=1 as an environment variable to disable the llhttp HTTP request parser implementation. The pure Python implementation isn't vulnerable to request smuggling:

console $ python -m pip uninstall --yes aiohttp $ AIOHTTPNOEXTENSIONS=1 python -m pip install --no-binary=aiohttp --no-cache aiohttp

References

https://nvd.nist.gov/vuln/detail/CVE-2023-30589 https://hackerone.com/reports/2001873

Other sources

aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. aiohttp v3.8.4 and earlier are bundled with llhttp v6.0.6. Vulnerable code is used by aiohttp for its HTTP request parser when available which is the default case when installing from a wheel. This vulnerability only affects users of aiohttp as an HTTP server (ie aiohttp.Application), you are not affected by this vulnerability if you are using aiohttp as an HTTP client library (ie aiohttp.ClientSession). Sending a crafted HTTP request will cause the server to misinterpret one of the HTTP header values leading to HTTP request smuggling. This issue has been addressed in version 3.8.5. Users are advised to upgrade. Users unable to upgrade can reinstall aiohttp using AIOHTTPNOEXTENSIONS=1 as an environment variable to disable the llhttp HTTP request parser implementation. The pure Python implementation isn't vulnerable.

This vulnerability only affects users of aiohttp as an HTTP server (ie aiohttp.Application), you are not affected by this vulnerability if you are using aiohttp as an HTTP client library (ie aiohttp.ClientSession). Sending a crafted HTTP request will cause the server to misinterpret one of the HTTP header values leading to HTTP request smuggling. This issue has been addressed in version 3.8.5. Users are advised to upgrade. Users unable to upgrade can reinstall aiohttp using AIOHTTPNOEXTENSIONS=1 as an environment variable to disable the llhttp HTTP request parser implementation. The pure Python implementation isn't vulnerable.

Reference:

https://github.com/aio-libs/aiohttp/security/advisories/GHSA-45c4-8wx5-qw6w

Red Hat

Affected Software

4 affected componentsFixes available
pip/aiohttp<=3.8.4
3.8.5
aiohttp aiohttp<=3.8.4
Aiohttp Project Aiohttp<=3.8.4
redhat/aiohttp<3.8.5
3.8.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/aiohttp to a version that resolves this vulnerability.

    Fixed in 3.8.5
  2. Upgrade

    Upgrade redhat/aiohttp to a version that resolves this vulnerability.

    Fixed in 3.8.5
  3. Upgrade

    Upgrade aiohttp to a version that resolves this vulnerability.

    Fixed in 3.8.5Patch CVE-2023-30589
  4. Configuration

    For environments unable to upgrade, reinstall aiohttp with the environment variable AIOHTTP_NO_EXTENSIONS=1 to disable the llhttp HTTP request parser implementation.

    aiohttp (llhttp HTTP request parser) AIOHTTP_NO_EXTENSIONS = 1

Event History

Jul 19, 2023
CVE Published
via MITRE·07:39 PM
Data Sourced
via MITRE·07:39 PM
DescriptionSeverityWeakness
Data Sourced
08:15 PM
DescriptionWeakness
Data Sourced
via NVD·08:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jul 20, 2023
Data Sourced
via Red Hat·07:04 AM
DescriptionSeverityAffected Software
Advisory Published
via GitHub·02:52 PM

Frequently Asked Questions

1

What is the vulnerability ID of this aiohttp vulnerability?

The vulnerability ID of this aiohttp vulnerability is CVE-2023-37276.

2

What is the impact of this vulnerability?

This vulnerability can allow remote attackers to cause a denial of service (DoS) or execute arbitrary code.

3

How can I fix this vulnerability?

You can fix this vulnerability by updating aiohttp to version 3.8.5 or later.

4

Where can I find more information about this vulnerability?

You can find more information about this vulnerability at the following references: [GitHub Security Advisory](https://github.com/aio-libs/aiohttp/security/advisories/GHSA-45c4-8wx5-qw6w) and [HackerOne Report](https://hackerone.com/reports/2001873).

5

What is the Common Weakness Enumeration (CWE) ID for this vulnerability?

The Common Weakness Enumeration (CWE) ID for this vulnerability is CWE-444.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203