{"vuln_id":"CVE-2025-1861","aliases":["CVE-2025-1217","CVE-2025-1219","CVE-2025-1734","CVE-2025-1736","GHSA-52jp-hrpf-2jff"],"description":"php8.2 - security update","published_at":"2025-03-13T17:44:03Z","modified_at":"2026-11-20T01:19:10.572133Z","first_seen_at":"2026-11-21T19:15:06.060508Z","severity":"critical","severity_source":"cvss","cvss_score":9.8,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cwe":[],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00856,"epss_percentile":0.59284,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2025-1861"},"matched_alias":null,"items":[{"id":649,"source":{"id":"gh-php-src","name":"PHP releases (GitHub php/php-src tags)"},"title":"GHSA-7875-c8px-7q5f / CVE-2026-93682: Out-of-bounds read in the HTTP stream wrapper when following a redirect with an empty Location header","summary":"Out-of-bounds read in the HTTP stream wrapper when following a redirect with an empty Location header\n\n### Summary\n\nWhen the HTTP stream wrapper follows a redirect and the response carries a `Location` header with an empty value, the redirect code reads one byte past the end of the heap buffer holding the location. The value of that out-of-bounds byte decides which redirect target is built, so a malicious server controls whether the client is sent to the host root or to the current directory.\n\n### Details\n\nSince the fix for GHSA-52jp-hrpf-2jff (CVE-2025-1861), `php_stream_http_response_headers_parse()` stores the `Location` value in a heap buffer of exactly `location_len + 1` bytes:\n\nhttps://github.com/php/php-src/blob/a66f30d78e10773048720b4b5f279136fdd0a433/ext/standard/http_fopen_wrapper.c#L295-L301\n\nFor an empty header value that is a single byte holding only the NUL terminator. The redirect handling in `php_stream_url_wrap_http_ex()` treats any location that does not start with `/` as a relative path and dereferences the second byte to decide whether to join it with the directory of the current request path:\n\nhttps://github.com/php/php-src/blob/a66f30d78e10773048720b4b5f279136fdd0a433/ext/standard/http_fopen_wrapper.c#L1055-L1063\n\n`*(header_info.location+1)` is one byte after the allocation.\n\nBefore CVE-2025-1861 was fixed, the location lived in a fixed-size `char location[HTTP_HEADER_BLOCK_SIZE]` stack buffer and the same read stayed in bounds. The bug therefore exists only in 8.1.32+, 8.2.28+, 8.3.18+, 8.4.5+ and all 8.5 releases.\n\nThe fix replaces `strlen(header_info.location)` with `header_info.location_len` and guards the second-byte read with the length, so an empty `Location` deterministically redirects to the host root. It was submitted and merged publicly, outside the security process, in https://github.com/php/php-src/pull/23467. A follow-up in https://github.com/php/php-src/pull/23521 corrected the guard from `location_len > 0` to `location_len > 1`, restoring the long-standing resolution of a single-character relative `Location`.\n\n### PoC\n\nA server answering `HTTP/1.1 302 Found\\r\\nLocation:\\r\\nContent-Length: 0\\r\\n\\r\\n` to this client:\n\n```php\n\n['follow_location' => 1]]);\nfile_get_contents(\"http://host/a/b\", false, $ctx);\n```\n\nThe next request goes to `/` when the stray byte happens to be NUL and to `/a//` otherwise. Under Valgrind with `USE_ZEND_ALLOC=0`:\n\n```\nInvalid read of size 1\nat php_stream_url_wrap_http_ex (http_fopen_wrapper.c:1044)\nby php_stream_url_wrap_http (http_fopen_wrapper.c:1186)\nby _php_stream_open_wrapper_ex (streams.c:2206)\nby zif_file_get_contents (file.c:426)\nAddress is 0 bytes after a block of size 1 alloc'd\nat malloc\nby _emalloc\nby php_stream_http_response_headers_parse (http_fopen_wrapper.c:268)\n```\n\nThe regression tests are `ext/standard/tests/http/http_empty_location_redirect.phpt` and `http_single_char_location_redirect.phpt`.\n\n### Impact\n\nAn attacker who controls a server that a PHP applic\n\nAffected packages: php:ext-standard\nPatched: ext-standard 8.2.34, ext-standard 8.3.35, ext-standard 8.4.26, ext-standard 8.5.11","url":"https://github.com/php/php-src/security/advisories/GHSA-7875-c8px-7q5f","published_at":"2026-09-24T10:07:25Z","updated_at":"2026-09-25T19:54:11Z","fetched_at":"2026-11-21T19:15:07.553383Z","severity":"critical","cvss_score":9.8,"epss":0.00856,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"ext-standard","vuln_id":"CVE-2026-93682","vuln_ids":["CVE-2025-1217","CVE-2025-1218","CVE-2025-1219","CVE-2025-14181","CVE-2025-1734","CVE-2025-1736","CVE-2025-1861","CVE-2026-6103","CVE-2026-91765","CVE-2026-91766","CVE-2026-91767","CVE-2026-91768","CVE-2026-91769","CVE-2026-92842","CVE-2026-93682","GHSA-52JP-HRPF-2JFF","GHSA-7875-C8PX-7Q5F"],"tags":["repo-advisory","php","CWE-125","security","repo:php/php-src"],"cluster_id":478,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/649","html":"https://vulnwatch.ve1ve2.com/item/649"}},{"id":11926,"source":{"id":"debian13-php","name":"Debian 13 php8.4 (package vulnerabilities)"},"title":"php8.4 (Debian:13): DEBIAN-CVE-2025-1861 / CVE-2025-1861 - In PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when parsing HTTP redirect in the response to an…","summary":"In PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when parsing HTTP redirect in the response to an HTTP request, there is currently limit on the location value size caused by limited size of the location buffer to 1024. However as per RFC9110, the limit is recommended to be 8000. This may lead to incorrect URL truncation and redirecting to a wrong location.\n\nAffected: Debian:12:php8.2, Debian:13:php8.4, Debian:14:php8.4\n\nFixed in: 8.4.5-1\n\nReferences:\nhttps://security-tracker.debian.org/tracker/CVE-2025-1861","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2025-1861","published_at":"2025-03-30T06:15:14.957000Z","updated_at":"2026-09-01T20:05:41.610742Z","fetched_at":"2026-11-22T13:39:48.366407Z","severity":"critical","cvss_score":9.8,"epss":0.00856,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php8.4","vuln_id":"CVE-2025-1861","vuln_ids":["CVE-2025-1217","CVE-2025-1219","CVE-2025-1734","CVE-2025-1736","CVE-2025-1861","DEBIAN-CVE-2025-1861","GHSA-52JP-HRPF-2JFF"],"tags":["package-watch","pkg:php8.4","stack","debian13","fix-available"],"cluster_id":369,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/11926","html":"https://vulnwatch.ve1ve2.com/item/11926"}},{"id":530,"source":{"id":"debian-php","name":"Debian 12 php8.2 (package vulnerabilities)"},"title":"php8.2 (Debian:12): DEBIAN-CVE-2025-1861 / CVE-2025-1861 - In PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when parsing HTTP redirect in the response to an…","summary":"In PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when parsing HTTP redirect in the response to an HTTP request, there is currently limit on the location value size caused by limited size of the location buffer to 1024. However as per RFC9110, the limit is recommended to be 8000. This may lead to incorrect URL truncation and redirecting to a wrong location.\n\nAffected: Debian:12:php8.2, Debian:13:php8.4, Debian:14:php8.4\n\nFixed in: 8.2.28-1~deb12u1\n\nReferences:\nhttps://security-tracker.debian.org/tracker/CVE-2025-1861","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2025-1861","published_at":"2025-03-30T06:15:14.957000Z","updated_at":"2026-09-01T20:05:41.610742Z","fetched_at":"2026-11-21T19:15:05.963798Z","severity":"critical","cvss_score":9.8,"epss":0.00856,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php8.2","vuln_id":"CVE-2025-1861","vuln_ids":["CVE-2025-1217","CVE-2025-1219","CVE-2025-1734","CVE-2025-1736","CVE-2025-1861","DEBIAN-CVE-2025-1861","GHSA-52JP-HRPF-2JFF"],"tags":["package-watch","pkg:php8.2","fix-available"],"cluster_id":369,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/530","html":"https://vulnwatch.ve1ve2.com/item/530"}},{"id":481,"source":{"id":"debian-php","name":"Debian 12 php8.2 (package vulnerabilities)"},"title":"php8.2 (Debian:12): DSA-5878-1 / CVE-2025-1217 - php8.2 - security update","summary":"Affected: Debian:12:php8.2\n\nFixed in: 8.2.28-1~deb12u1","url":"https://osv.dev/vulnerability/DSA-5878-1","published_at":"2025-03-14T00:00:00Z","updated_at":"2026-11-20T01:19:10.572133Z","fetched_at":"2026-11-21T19:15:05.963726Z","severity":"critical","cvss_score":9.8,"epss":0.00856,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php8.2","vuln_id":"CVE-2025-1217","vuln_ids":["CVE-2025-1217","CVE-2025-1219","CVE-2025-1734","CVE-2025-1736","CVE-2025-1861","DSA-5878-1","GHSA-52JP-HRPF-2JFF","GHSA-HGF5-96FM-V528","GHSA-P3X9-6H7P-CGFC","GHSA-PCMH-G36C-QC44","GHSA-V8XR-GPVJ-CX9G"],"tags":["package-watch","pkg:php8.2","fix-available"],"cluster_id":365,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/481","html":"https://vulnwatch.ve1ve2.com/item/481"}},{"id":12658,"source":{"id":"gh-php-src","name":"PHP releases (GitHub php/php-src tags)"},"title":"GHSA-52jp-hrpf-2jff / CVE-2025-1861: Stream HTTP wrapper truncate redirect location to 1024 bytes","summary":"Stream HTTP wrapper truncate redirect location to 1024 bytes\n\nThere is currently limit on the location value size caused by limited size of the location buffer to 1024. However as per https://www.rfc-editor.org/rfc/rfc9110#name-uri-references , the limit is recommended to 8000. The browser limit is usually around 2048 so 1024 is really too low and it might have a real impact in practice.\r\n\r\n### Impact\r\n\r\nThe URI truncation might result in omitting some critical information (e.g. from the query) or even redirection to other resources. It could even result in DOS of the remote site if the trucated URL results in error.\r\n\r\n### Workarounds\r\n\r\nThere is no real workaround for this\r\n\r\n\nPatched:  8.1.32,  8.2.28,  8.3.19,  8.4.5","url":"https://github.com/php/php-src/security/advisories/GHSA-52jp-hrpf-2jff","published_at":"2025-03-13T17:44:03Z","updated_at":"2025-03-13T17:44:03Z","fetched_at":"2026-11-22T14:05:37.431192Z","severity":"critical","cvss_score":9.8,"epss":0.00856,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php-src","vuln_id":"CVE-2025-1861","vuln_ids":["CVE-2025-1217","CVE-2025-1219","CVE-2025-1734","CVE-2025-1736","CVE-2025-1861","GHSA-52JP-HRPF-2JFF"],"tags":["repo-advisory","security","repo:php/php-src","stack"],"cluster_id":479,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12658","html":"https://vulnwatch.ve1ve2.com/item/12658"}}]}