CVE-2026-55766: guzzlehttp/psr7 CR/LF Injection in HTTP Start-Line Fields
guzzlehttp/psr7, a widely-used PHP library for handling HTTP messages, fails to properly sanitize certain HTTP protocol fields when processing attacker-controlled input. Specifically, carriage return and line feed (CR/LF) characters are not rejected in the request method, protocol version, and response reason phrase. If an application accepts untrusted data and uses psr7 to serialize messages for network transmission, an attacker could inject additional HTTP headers into the serialized output, potentially bypassing security controls or manipulating message intent. The vulnerability requires deliberate serialization to HTTP/1.x format; simply creating or modifying a PSR-7 object is not exploitable on its own.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 4.8 MEDIUM · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
- Weaknesses (CWE)
- CWE-113, CWE-93
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-23 / 2026-06-30
NVD description (verbatim)
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.
1 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
guzzlehttp/psr7 versions prior to 2.12.1 permit CR/LF injection into HTTP message start-line fields (request method, HTTP protocol version, response reason phrase). When a PSR-7 Message object is serialized via Message::toString() or equivalent mechanisms, these unvalidated characters can introduce unauthorized header lines into the raw HTTP output. The attack vector also includes parsing malformed raw HTTP via Message::parseRequest() or Message::parseResponse(), then re-serializing the parsed object. The vulnerability aligns with CWE-113 (Improper Neutralization of CRLF Sequences in HTTP Headers) and CWE-93 (Improper Neutralization of CRLF Sequences in a HTTP Response). Exploitation requires downstream processing of the malformed serialized message—direct object manipulation alone does not trigger the flaw.
Business impact
Applications relying on psr7 for HTTP message handling face header injection risks if they accept user input, serialize messages, and transmit or forward those messages across trust boundaries. This could enable attackers to inject fake headers, authenticate as different users, manipulate response caching, or bypass security middleware. The actual risk depends heavily on application architecture: frameworks that validate message structure independently or reject malformed input on receipt are less exposed. Organizations using psr7 in request-building or response-forwarding logic should prioritize assessment of their data flow.
Affected systems
All versions of guzzlehttp/psr7 prior to 2.12.1 are affected. The vulnerability impacts PHP applications that use psr7 and pass user-controlled data into HTTP message start-line fields. Secondary exposure occurs when applications parse raw HTTP input into PSR-7 objects without independent validation, then re-serialize and transmit those messages.
Exploitability
Exploitation requires multiple conditions: attacker control over start-line fields, serialization to HTTP/1.x format, and downstream processing that does not independently validate message syntax. The CVSS 4.8 MEDIUM score reflects this complexity. Active exploitation is not documented (KEV status: not listed). The attack surface is real but constrained by typical defensive practices (input validation, output encoding) already in place in mature applications.
Remediation
Upgrade guzzlehttp/psr7 to version 2.12.1 or later. If immediate upgrade is infeasible, applications should implement input validation to reject CR/LF characters in any user-controlled data destined for HTTP start-line fields before passing it to psr7. Additionally, validate serialized HTTP messages before transmission or forwarding.
Patch guidance
Update guzzlehttp/psr7 to 2.12.1 or a later release via composer update guzzlehttp/psr7. Verify the updated version by checking composer.lock or running composer show guzzlehttp/psr7. Test serialization behavior on your application's request and response handling paths to confirm the fix does not introduce compatibility issues with legacy upstream or downstream systems.
Detection guidance
Monitor application logs and network traffic for unusual CR/LF sequences in HTTP start lines. When psr7 is deployed, audit code paths that accept user input and pass it to message start-line fields; confirm that serialized output is either discarded or validated before transmission. Security testing tools that fuzz HTTP message construction with CR/LF payloads can identify vulnerable code patterns. Runtime monitoring for unexpected additional headers in outbound HTTP may surface exploitation attempts.
Why prioritize this
While CVSS is MEDIUM (4.8) and the vulnerability is not yet widely exploited, organizations using psr7 in request-building or forwarding roles should prioritize patching because header injection flaws can enable authentication bypass, cache poisoning, and security control circumvention. The fix is low-risk (a library update) and adoption should be straightforward for most PHP projects.
Risk score, explained
The CVSS 3.1 score of 4.8 reflects low-to-moderate impact: CR/LF injection enables header manipulation (confidentiality and integrity concerns) but only under specific conditions (high complexity, no direct network elevation of privilege, no availability impact). The score accounts for the requirement that serialization and downstream processing both occur without independent validation. Absence from the KEV catalog indicates no evidence of active in-the-wild exploitation.
Frequently asked questions
Does this vulnerability affect my PHP application if I only use psr7 to parse incoming HTTP requests without serializing them back?
Partial risk remains if your application later re-serializes those parsed messages (for logging, forwarding, or caching). If you only parse and extract data without downstream serialization, the direct attack surface is smaller, but you should still upgrade to close the attack vector entirely.
What is the difference between this and standard HTTP header injection?
Standard header injection typically targets field values (the part after the colon). This flaw targets HTTP start-line components (method, protocol version, reason phrase), which are normally treated as trusted structural elements. The exploit injects additional complete header lines by smuggling CR/LF into these fields.
Is there a workaround if I cannot upgrade immediately?
Implement input validation before any user-controlled data reaches psr7 message start-line fields. Explicitly reject or sanitize CR/LF characters (\r and \n) in method names, protocol versions, and reason phrases. Also validate serialized output before forwarding or transmitting.
Does this affect message creation via the standard PSR-7 API, or only serialization?
Creating or modifying a PSR-7 object directly is safe. The vulnerability emerges when attacker-controlled strings are placed into start-line fields and the message is then serialized to HTTP/1.x format (via toString() or similar). The flaw is in the serialization layer, not in the object model itself.
This analysis is provided for informational purposes to support vulnerability assessment and patch planning. It does not constitute legal, compliance, or professional security advice. Organizations must independently verify all technical details against official vendor advisories and conduct their own risk assessment based on their specific infrastructure, dependencies, and business requirements. SEC.co makes no warranty regarding the accuracy or completeness of this information and assumes no liability for decisions made in reliance upon it. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-49214MEDIUMguzzlehttp/psr7 HTTP Header Injection via Untrusted URLs
- CVE-2026-50269HIGHAIOHTTP Header Injection in Multipart Payloads
- CVE-2026-38978MEDIUMTransmission Clickjacking Vulnerability in WebUI and RPC Paths
- CVE-2026-46739MEDIUMNet::Statsd Metric Injection Vulnerability (Perl)
- CVE-2026-47675MEDIUMHono Cookie Injection Vulnerability in sameSite and priority Parameters
- CVE-2026-49130MEDIUMMusic Player Daemon CRLF Injection in XSPF Playlists
- CVE-2026-50629MEDIUMApache CXF OAuth2 Log Injection Vulnerability (CVSS 5.3)
- CVE-2026-50630MEDIUMApache CXF OAuth2 CRLF Injection Vulnerability