{"vuln_id":"GHSA-c5f2-jwm7-mmq2","aliases":["CVE-2024-11234"],"description":"Configuring a proxy in a stream context might allow for CRLF injection in URIs","published_at":"2024-11-21T18:15:25Z","modified_at":"2024-11-21T18:15:25Z","first_seen_at":"2026-11-22T14:05:37.623092Z","severity":"medium","severity_source":"ghsa","cvss_score":null,"cvss_vector":null,"cwe":["CWE-93"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-c5f2-jwm7-mmq2"},"matched_alias":null,"items":[{"id":12663,"source":{"id":"gh-php-src","name":"PHP releases (GitHub php/php-src tags)"},"title":"GHSA-c5f2-jwm7-mmq2 / CVE-2024-11234: Configuring a proxy in a stream context might allow for CRLF injection in URIs","summary":"Configuring a proxy in a stream context might allow for CRLF injection in URIs\n\n### Summary\r\n\r\nConfiguring a proxy in a [stream context](https://www.php.net/manual/en/stream.contexts.php) might allow for CRLF injection in URIs, resulting in HTTP request smuggling attacks.\r\n\r\n### Details\r\n\r\nWhen creating a stream using one of the available stream creation functions (e.g., `fopen`, `file`, `file_get_contents`...), developers can specify a custom stream context containing a set of parameters to use during the connection. One such parameter, in the case of HTTP and FTP streams, is `proxy`. The HTTP context options also include a `request_fulluri` boolean, which is required by some proxies to correctly forward the request.\r\n\r\nWhile a normal request to `http://example.com/path/to/file?query` would results in the following HTTP request:\r\n\r\n```http\r\nGET /path/to/file?query HTTP/1.1\r\n```\r\n\r\nwhen setting `request_fulluri` to `true` we obtain:\r\n\r\n```http\r\nGET http://example.com/path/to/file?query HTTP/1.1\r\n```\r\n\r\nThe vulnerability lies in the [implementation of `request_fulluri`](https://github.com/php/php-src/blob/0d616d1b82ca7609a7ece762cb8688d9bed74370/ext/standard/http_fopen_wrapper.c#L393), which just inserts the raw URI into the HTTP request line. In particular, this bypasses the normal [control characters sanitization](https://github.com/php/php-src/blob/0d616d1b82ca7609a7ece762cb8688d9bed74370/ext/standard/url.c#L53) usually performed [when parsing the URL](https://github.com/php/php-src/blob/0d616d1b82ca7609a7ece762cb8688d9bed74370/ext/standard/url.c#L323).\r\n\r\nThis means that, if the resource URI is under the partial control of an attacker, when the `request_fulluri` context parameter is true, a malicious actor could inject CRLF characters to perform a HTTP request smuggling attack.\r\n\r\nFurthermore, if a non-HTTP stream sets a `proxy` parameter in the context (right now only the FTP context supports this), the `request_fulluri` parameter gets [automatically silently enabled](https://github.com/php/php-src/blob/0d616d1b82ca7609a7ece762cb8688d9bed74370/ext/standard/http_fopen_wrapper.c#L164) without the developer ever knowing.\r\n\r\nNotice that, in the case of HTTP streams, setting a proxy is not strictly necessary, as the real issue is the `request_fulluri` parameter.\r\n\r\n### PoC\r\n\r\nWe can test the raw query performed by PHP by simply using netcat in listening mode (`nc -lvnp 1337`).\r\n\r\nWhen no proxy is configured, the malicious input is correctly sanitized (still producing an error due to the presence of unencoded spaces):\r\n\r\n```php\r\n$userinput = \" HTTP/1.1\\r\\nHost: localhost:1337\\r\\n\\r\\nGET /admin HTTP/1.1\\r\\nHost: adminpanel\\r\\n\\r\\nGET /\";\r\n\r\nfile_get_contents(\"http://localhost:1337/$userinput\");\r\n```\r\n\r\n```http\r\nGET / HTTP/1.1__Host: localhost:1337____GET /admin HTTP/1.1__Host: adminpanel____GET / HTTP/1.1\r\nHost: localhost:1337\r\nConnection: close\r\n```\r\n\r\nWhen using a proxy and setting `request_fulluri` to `true`, we get request smuggling:\r\n\r\n```php\r\n$opts = ['http' => ['proxy' => 'tcp://localhost:1337', 'request_fulluri' => true\nPatched:  8.1.31,  8.2.26,  8.3.14","url":"https://github.com/php/php-src/security/advisories/GHSA-c5f2-jwm7-mmq2","published_at":"2024-11-21T18:15:25Z","updated_at":"2024-11-21T18:15:25Z","fetched_at":"2026-11-22T14:05:37.431195Z","severity":"high","cvss_score":7.2,"epss":0.01108,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php-src","vuln_id":"CVE-2024-11234","vuln_ids":["CVE-2024-11233","CVE-2024-11234","CVE-2024-11236","CVE-2024-8929","CVE-2024-8932","GHSA-C5F2-JWM7-MMQ2"],"tags":["repo-advisory","CWE-93","security","repo:php/php-src","stack"],"cluster_id":11771,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12663","html":"https://vulnwatch.ve1ve2.com/item/12663"}}]}