Advisory

PYSEC-2026-1222

Also known as: CVE-2026-22779, GHSA-6pw3-h7xf-x4gp

Summary

BlackSheep's ClientSession is vulnerable to CRLF injection

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

Severity

Not rated by the source.

Dates

Published
2026-07-07 16:03 UTC
Modified
2026-07-07 17:47 UTC

Affected packages and fixes

blacksheep

PyPI · All systems

Affected

  • introduced 0, fixed 2.4.6 (ecosystem)

Fixed versions

2.4.6

Fix

  • Fixed version 2.4.6
    pip install --upgrade blacksheep==2.4.6

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences