4.8medium
guzzlehttp/psr7: CRLF Injection in HTTP Start-Line Serialization
- Severity
- 4.8medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.16% (higher than 5% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-vm85-hxw5-5432
Description
guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Prior to 2.12.1, guzzlehttp/psr7 did not reject CR/LF characters in certain first-party HTTP start-line fields: the request method, protocol version, and response reason phrase. If an application placed attacker-controlled data into one of those fields and later serialized the PSR-7 message as raw HTTP/1.x, for example with Message::toString() or an equivalent serializer, the serialized message could contain attacker-controlled header lines. The issue can also be reached through Message::parseRequest() or Message::parseResponse() when malformed raw messages are parsed into first-party PSR-7 objects and then serialized again. Creating or modifying a Request, Response, or other PSR-7 object alone is not sufficient. The issue requires the malformed message to be serialized and written to the network, forwarded, replayed, or otherwise processed by software that does not independently reject the malformed start line. This vulnerability is fixed in 2.12.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| guzzle psr7 | < 2.12.1 | CVE List |
| guzzlehttp/psr7 (Packagist) | before 2.12.1 | GitHub Advisory Database |
| guzzlephp psr-7 | before 2.12.1 | NVD |
All scores
| GitHub_M | 4.8medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N |
| GitHub | 4.8medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N |
Classification
What each source says
CVE List
guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Prior to 2.12.1, guzzlehttp/psr7 did not reject CR/LF characters in certain first-party HTTP start-line fields: the request method, protocol version, and response reason phrase. If an application placed attacker-controlled data into one of those fields and later serialized the PSR-7 message as raw HTTP/1.x, for example with Message::toString() or an equivalent serializer, the serialized message could contain attacker-controlled header lines. The issue can also be reached through Message::parseRequest() or Message::parseResponse() when malformed raw messages are parsed into first-party PSR-7 objects and then serialized again. Creating or modifying a Request, Response, or other PSR-7 object alone is not sufficient. The issue requires the malformed message to be serialized and written to the network, forwarded, replayed, or otherwise processed by software that does not independently reject the malformed start line. This vulnerability is fixed in 2.12.1.
GitHub Advisory Database
Impact
guzzlehttp/psr7 did not reject CR/LF characters in certain first-party HTTP start-line fields: the request method, protocol version, and response reason phrase. If an application placed attacker-controlled data into one of those fields and later serialized the PSR-7 message as raw HTTP/1.x, for example with Message::toString() or an equivalent serializer, the serialized message could contain attacker-controlled header lines. The issue can also be reached through Message::parseRequest() or Message::parseResponse() when malformed raw messages are parsed into first-party PSR-7 objects and then serialized again.
Creating or modifying a Request, Response, or other PSR-7 object alone is not sufficient. The issue requires the malformed message to be serialized and written to the network, forwarded, replayed, or otherwise processed by software that does not independently reject the malformed start line. This is not the normal request-sending path used by guzzlehttp/guzzle; applications using guzzlehttp/psr7 only through Guzzle's standard HTTP client APIs are not expected to be affected.
Applications are most likely to be affected when they manually serialize PSR-7 messages, forward raw HTTP messages, or use custom transports, proxying, crawling, webhook delivery, testing, or similar code. Depending on how downstream HTTP/1.1 components parse the serialized message, this may lead to header injection, response splitting, request smuggling, or cache poisoning.
Patches
The issue is patched in 2.12.1 and later. Starting in that release, guzzlehttp/psr7 rejects CR/LF characters in HTTP method, protocol version, and response reason phrase values before storing them in first-party message objects.
Workarounds
If you cannot upgrade immediately, reject CR/LF in untrusted method, protocol version, and reason phrase values before constructing or modifying PSR-7 messages.
Applications that parse, forward, replay, or serialize raw HTTP messages cannot work around the parser entry points by validating only after parsing. They should validate the raw start line before calling Message::parseRequest() or Message::parseResponse(), avoid reparsing untrusted raw messages, or upgrade. If an application runs with attacker-controlled synthetic $_SERVER values, validate REQUEST_METHOD and SERVER_PROTOCOL before calling ServerRequest::fromGlobals().
NVD (es)
guzzlehttp/psr7 es una implementación de biblioteca de mensajes HTTP PSR-7 en PHP. Antes de la versión 2.12.1, guzzlehttp/psr7 no rechazaba los caracteres CR/LF en ciertos campos de línea de inicio HTTP de primera parte: el método de solicitud, la versión del protocolo y la frase de motivo de respuesta. Si una aplicación colocaba datos controlados por el atacante en uno de esos campos y luego serializaba el mensaje PSR-7 como HTTP/1.x sin procesar, por ejemplo, con Message::toString() o un serializador equivalente, el mensaje serializado podría contener líneas de encabezado controladas por el atacante. El problema también puede alcanzarse a través de Message::parseRequest() o Message::parseResponse() cuando los mensajes sin procesar malformados se analizan en objetos PSR-7 de primera parte y luego se serializan de nuevo. Crear o modificar un objeto Request, Response u otro objeto PSR-7 por sí solo no es suficiente. El problema requiere que el mensaje malformado sea serializado y escrito a la red, reenviado, reproducido o procesado de otra manera por software que no rechace de forma independiente la línea de inicio malformada. Esta vulnerabilidad está corregida en la versión 2.12.1.
References
| https://github.com/guzzle/psr7/security/advisories/GHSA-vm85-hxw5-5432 | mitigation, vendor-advisory, web | |
| https://github.com/guzzle/psr7 | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-55766 changed 2026-06-23 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-vm85-hxw5-5432 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-55766 changed 2026-10-25 | Public domain |