MediumGHSA-q3qx-c6g2-7pw2CVE-2023-49081PYSEC-2023-250

aiohttp's ClientSession is vulnerable to CRLF injection via version

Published 27 Nov 2023 · Updated 10 Sept 2026

Is your project on an affected aiohttp?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
<3.9.0
Fixed in
3.9.0
Update to the fixed version for your release line, for example:pip install 'aiohttp>=3.9.0'

Details

Summary

Improper validation make it possible for an attacker to modify the HTTP request (e.g. to insert a new header) or even create a new HTTP request if the attacker controls the HTTP version.

Details

The vulnerability only occurs if the attacker can control the HTTP version of the request (including its type). For example if an unvalidated JSON value is used as a version and the attacker is then able to pass an array as the version parameter. Furthermore, the vulnerability only occurs when the Connection header is passed to the headers parameter.

At this point, the library will use the parsed value to create the request. If a list is passed, then it bypasses validation and it is possible to perform CRLF injection.

PoC

The POC below shows an example of providing an unvalidated array as a version: https://gist.github.com/jnovikov/184afb593d9c2114d77f508e0ccd508e

Impact

CRLF injection leading to Request Smuggling.

Workaround

If these specific conditions are met and you are unable to upgrade, then validate the user input to the version parameter to ensure it is a str.

Patch: https://github.com/aio-libs/aiohttp/pull/7835/files

Is GHSA-q3qx-c6g2-7pw2 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected aiohttp, and gives you the command that fixes it.

More advisories for aiohttp

  • HighCVE-2026-128124AIOHTTP: Event loop stall in add_domain() wildcard matching · 16 Nov 2026
  • MediumCVE-2026-128125AIOHTTP: Unbounded cookie storage in client CookieJar · 16 Nov 2026
  • HighCVE-2026-128126AIOHTTP: Too many URL-encoded form fields block the event loop · 16 Nov 2026
  • HighCVE-2026-128127AIOHTTP: Base64 multipart parts bypass client_max_size · 16 Nov 2026
  • HighCVE-2026-128128AIOHTTP: WebSocket max_msg_size bypass via integer overflow · 16 Nov 2026
  • HighCVE-2026-128129AIOHTTP: Unbounded buffering of data received during an upgrade request · 16 Nov 2026
All 64 advisories for aiohttp

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.