{"id":"CVE-2026-49214","aliases":["CVE-2026-49214","GHSA-hq7v-mx3g-29hw"],"related":[],"kind":"vulnerability","state":"published","title":"guzzlehttp/psr7 has CRLF Injection via URI Host Component","summary":"guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Versions prior to 2.10.2 did not reject ASCII control characters, whitespace, or DEL in first-party URI host components. A vulnerable flow is: First, an application accepts a user-controlled URL. Second, the URL is used to construct a PSR-7 `Uri` or `Request`. Third, the host component contains CRLF or another header-unsafe character. Fourth, the host is copied into the PSR-7 `Host` header when no explicit `Host` header is provided. Finally, the request is serialized or sent by an HTTP client that does not independently reject the malformed host. In that flow, an attacker can cause the serialized request to contain additional attacker-controlled header lines. For example, a host containing `\"\\r\\nX-Injected: yes\"` can cause the generated `Host` header to span multiple HTTP header lines. Applications are affected when they use user-controlled URLs for outbound HTTP requests, URL forwarding, proxying, crawling, webhook delivery, or similar request-dispatch flows. In deployments involving HTTP/1.1 connection reuse, proxies, gateways, or load balancers, this malformed request may also contribute to request smuggling or cache poisoning, depending on how downstream components parse the request. The issue is patched in `2.10.2` and later. `1.x` is end-of-life and will not receive a patch. As a workaround, validate and reject all untrusted URI strings before constructing PSR-7 `Uri` or `Request` instances. Reject input containing ASCII control characters, whitespace, or DEL, including CRLF, tab, space, NUL, or DEL characters. Applications that forward requests should also ensure the final HTTP client or serializer rejects invalid URI and header data before writing requests to the network.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"guzzlehttp/psr7 is a PSR-7 HTTP message library implementation in PHP. Versions prior to 2.10.2 did not reject ASCII control characters, whitespace, or DEL in first-party URI host components. A vulnerable flow is: First, an application accepts a user-controlled URL. Second, the URL is used to construct a PSR-7 `Uri` or `Request`. Third, the host component contains CRLF or another header-unsafe character. Fourth, the host is copied into the PSR-7 `Host` header when no explicit `Host` header is provided. Finally, the request is serialized or sent by an HTTP client that does not independently reject the malformed host. In that flow, an attacker can cause the serialized request to contain additional attacker-controlled header lines. For example, a host containing `\"\\r\\nX-Injected: yes\"` can cause the generated `Host` header to span multiple HTTP header lines. Applications are affected when they use user-controlled URLs for outbound HTTP requests, URL forwarding, proxying, crawling, webhook delivery, or similar request-dispatch flows. In deployments involving HTTP/1.1 connection reuse, proxies, gateways, or load balancers, this malformed request may also contribute to request smuggling or cache poisoning, depending on how downstream components parse the request. The issue is patched in `2.10.2` and later. `1.x` is end-of-life and will not receive a patch. As a workaround, validate and reject all untrusted URI strings before constructing PSR-7 `Uri` or `Request` instances. Reject input containing ASCII control characters, whitespace, or DEL, including CRLF, tab, space, NUL, or DEL characters. Applications that forward requests should also ensure the final HTTP client or serializer rejects invalid URI and header data before writing requests to the network.","source":"cvelist"},{"lang":"en","text":"## Impact\n\n`guzzlehttp/psr7` did not reject ASCII control characters, whitespace, or DEL in first-party URI host components. The issue requires a PSR-7 request to be serialized into a raw HTTP/1.x message, for example with `GuzzleHttp\\Psr7\\Message::toString()` or an equivalent custom serializer. Creating a `Uri`, `Request`, or other PSR-7 object alone is not sufficient. The malformed host must be copied into the serialized `Host` header without further validation.\n\nA vulnerable flow is:\n\n1. An application accepts a user-controlled URL.\n2. The URL is used to construct a PSR-7 `Uri` or `Request`.\n3. The host component contains CRLF or another header-unsafe character.\n4. The request is serialized into a raw HTTP/1.x message without an explicit `Host` header.\n5. The host is copied into the serialized `Host` header.\n6. The serialized request is written to the network or otherwise processed by software that does not independently reject the malformed host.\n\nIn that flow, an attacker can cause the serialized request to contain additional attacker-controlled header lines. For example, a host containing `\"\\r\\nX-Injected: yes\"` can cause the generated `Host` header to span multiple HTTP header lines.\n\nThis 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 requests, forward raw HTTP messages, or use custom transports, proxying, crawling, webhook delivery, or similar request-dispatch code that serializes requests without independently validating URI hosts and header data. In deployments involving HTTP/1.1 connection reuse, proxies, gateways, or load balancers, this malformed serialized request may also contribute to request smuggling or cache poisoning, depending on how downstream components parse the request.\n\n## Patches\n\nThe issue is patched in `2.10.2` and later. `1.x` is end-of-life and will not receive a patch.\n\n## Workarounds\n\nIf you cannot upgrade immediately, validate and reject all untrusted URI strings before constructing PSR-7 `Uri` or `Request` instances. Reject input containing ASCII control characters, whitespace, or DEL, including CRLF, tab, space, NUL, or DEL characters:\n\n```php\nif (preg_match('/[\\x00-\\x20\\x7F]/', $untrustedUrl)) {\n    throw new \\InvalidArgumentException('Insecure URL detected');\n}\n```\n\nApplications that manually serialize or forward requests should also ensure the final HTTP client, transport, or serializer rejects invalid URI and header data before writing requests to the network.\n\n## References\n\n* https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2\n* https://www.rfc-editor.org/rfc/rfc9112.html#section-5\n* https://www.rfc-editor.org/rfc/rfc9112.html#section-11.2\n* https://www.rfc-editor.org/rfc/rfc9110.html#section-7.2","format":"markdown","source":"ghsa"},{"lang":"es","text":"guzzlehttp/psr7 es una implementación de la biblioteca de mensajes HTTP PSR-7 en PHP. Las versiones anteriores a la 2.10.2 no rechazaban caracteres de control ASCII, espacios en blanco o DEL en los componentes de host URI de origen. Un flujo vulnerable es: Primero, una aplicación acepta una URL controlada por el usuario. Segundo, la URL se utiliza para construir un ’Uri’ o ’Request’ PSR-7. Tercero, el componente de host contiene CRLF u otro carácter inseguro para encabezados. Cuarto, el host se copia en el encabezado ’Host’ PSR-7 cuando no se proporciona un encabezado ’Host’ explícito. Finalmente, la solicitud es serializada o enviada por un cliente HTTP que no rechaza de forma independiente el host malformado. En ese flujo, un atacante puede hacer que la solicitud serializada contenga líneas de encabezado adicionales controladas por el atacante. Por ejemplo, un host que contenga ’’\\r\\nX-Injected: yes’’ puede hacer que el encabezado ’Host’ generado abarque múltiples líneas de encabezado HTTP. Las aplicaciones se ven afectadas cuando utilizan URLs controladas por el usuario para solicitudes HTTP salientes, reenvío de URLs, proxying, rastreo, entrega de webhooks o flujos de despacho de solicitudes similares. En implementaciones que involucran la reutilización de conexiones HTTP/1.1, proxies, gateways o balanceadores de carga, esta solicitud malformada también puede contribuir al contrabando de solicitudes o al envenenamiento de caché, dependiendo de cómo los componentes posteriores analicen la solicitud. El problema está parcheado en la ’2.10.2’ y versiones posteriores. ’1.x’ ha llegado al fin de su vida útil y no recibirá un parche. Como solución alternativa, valide y rechace todas las cadenas URI no confiables antes de construir instancias de ’Uri’ o ’Request’ PSR-7. Rechace la entrada que contenga caracteres de control ASCII, espacios en blanco o DEL, incluyendo caracteres CRLF, tab, espacio, NUL o DEL. Las aplicaciones que reenvían solicitudes también deben asegurarse de que el cliente HTTP o serializador final rechace los datos URI y de encabezado no válidos antes de escribir las solicitudes en la red.","source":"nvd"}],"published":"2026-06-11T12:38:22.325Z","modified":"2026-10-25T23:10:00.167Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-20","CWE-93","CWE-113"],"affected":[{"ranges":[{"version":"< 2.10.2","status":"affected"}],"vendor":"guzzle","product":"psr7","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.10.2"}],"ecosystem":"Packagist","package":"guzzlehttp/psr7","purl":"pkg:composer/guzzlehttp/psr7","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.10.2"}],"vendor":"guzzlephp","product":"psr-7","cpe":"cpe:2.3:a:guzzlephp:psr-7:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/guzzle/psr7/security/advisories/GHSA-hq7v-mx3g-29hw","tags":["mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49214","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/guzzlehttp/psr7/CVE-2026-49214.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/guzzle/psr7","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-06-11T12:47:38.984Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-49214","url":"https://www.cve.org/CVERecord?id=CVE-2026-49214","licence":"CVE Terms of Use","modified":"2026-06-11T12:47:51.084Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hq7v-mx3g-29hw","url":"https://github.com/advisories/GHSA-hq7v-mx3g-29hw","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:49.920Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-49214","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49214","licence":"Public domain","modified":"2026-10-25T23:10:00.167Z"}],"updatedAt":"2026-11-25T22:59:24.423Z","epss":{"score":0.0019,"percentile":0.09032,"date":"2026-12-01T12:00:22.000Z"}}