PYSEC-2026-1222
BlackSheep's ClientSession is vulnerable to CRLF injection
Quick fix
PYSEC-2026-1222 — blacksheep: upgrade to the fixed version with the command below.
pip install --upgrade 'blacksheep>=2.4.6'Details
### Impact The HTTP Client implementation in BlackSheep is vulnerable to CRLF injection. Missing headers validation makes it possible for an attacker to modify the HTTP requests (e.g. insert a new header) or even create a new HTTP request. Exploitation requires developers to pass unsanitized user input directly into headers. The server part is not affected because BlackSheep delegates to an underlying ASGI server handling of response headers.
**Attack vector:** Applications using user input in HTTP client requests (method, URL, headers).
### Patches Users who use the HTTP Client in BlackSheep should upgrade to `2.4.6`.
### Workarounds If users handle headers from untrusted parties, they might reject values for header names and values that contain carriage returns.
### References https://owasp.org/www-community/vulnerabilities/CRLF_Injection
Are you affected?
Enter the version of the package you're using.
Affected packages
References
- https://github.com/Neoteroi/BlackSheep/security/advisories/GHSA-6pw3-h7xf-x4gp[WEB]
- https://nvd.nist.gov/vuln/detail/CVE-2026-22779[ADVISORY]
- https://github.com/Neoteroi/BlackSheep/commit/bd4ecb9542b5d52442276b5a6907931b90f38d12[WEB]
- https://github.com/Neoteroi/BlackSheep[PACKAGE]
- https://github.com/Neoteroi/BlackSheep/releases/tag/v2.4.6[WEB]
- https://pypi.org/project/blacksheep[PACKAGE]
- https://github.com/advisories/GHSA-6pw3-h7xf-x4gp[ADVISORY]