{"vuln_id":"CVE-2024-8927","aliases":["CVE-2024-8925","CVE-2024-8926","CVE-2024-9026","GHSA-94p6-54jq-9mwp"],"description":"php8.2 - security update","published_at":"2024-09-27T17:51:24Z","modified_at":"2026-11-20T01:19:10.140574Z","first_seen_at":"2026-11-21T19:15:06.060520Z","severity":"high","severity_source":"cvss","cvss_score":7.5,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","cwe":[],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.01054,"epss_percentile":0.65079,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2024-8927"},"matched_alias":null,"items":[{"id":488,"source":{"id":"debian-php","name":"Debian 12 php8.2 (package vulnerabilities)"},"title":"php8.2 (Debian:12): DEBIAN-CVE-2024-8927 / CVE-2024-8927 - In PHP versions 8.1.* before 8.1.30, 8.2.* before 8.2.24, 8.3.* before 8.3.12, HTTP_REDIRECT_STATUS variable is used to check whether or not CGI binary is bein…","summary":"In PHP versions 8.1.* before 8.1.30, 8.2.* before 8.2.24, 8.3.* before 8.3.12, HTTP_REDIRECT_STATUS variable is used to check whether or not CGI binary is being run by the HTTP server. However, in certain scenarios, the content of this variable can be controlled by the request submitter via HTTP headers, which can lead to cgi.force_redirect option not being correctly applied. In certain configurations this may lead to arbitrary file inclusion in PHP.\n\nAffected: Debian:12:php8.2\n\nFixed in: 8.2.24-1~deb12u1\n\nReferences:\nhttps://security-tracker.debian.org/tracker/CVE-2024-8927","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2024-8927","published_at":"2024-10-08T04:15:10.867000Z","updated_at":"2026-11-02T12:03:15.838160Z","fetched_at":"2026-11-21T19:15:05.963737Z","severity":"high","cvss_score":7.5,"epss":0.01054,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php8.2","vuln_id":"CVE-2024-8927","vuln_ids":["CVE-2024-8925","CVE-2024-8926","CVE-2024-8927","CVE-2024-9026","DEBIAN-CVE-2024-8927","GHSA-94P6-54JQ-9MWP"],"tags":["package-watch","pkg:php8.2","fix-available"],"cluster_id":377,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/488","html":"https://vulnwatch.ve1ve2.com/item/488"}},{"id":483,"source":{"id":"debian-php","name":"Debian 12 php8.2 (package vulnerabilities)"},"title":"php8.2 (Debian:12): DSA-5780-1 / CVE-2024-8925 - php8.2 - security update","summary":"Affected: Debian:12:php8.2\n\nFixed in: 8.2.24-1~deb12u1","url":"https://osv.dev/vulnerability/DSA-5780-1","published_at":"2024-10-02T00:00:00Z","updated_at":"2026-11-20T01:19:10.140574Z","fetched_at":"2026-11-21T19:15:05.963730Z","severity":"high","cvss_score":8.8,"epss":0.03662,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php8.2","vuln_id":"CVE-2024-8925","vuln_ids":["CVE-2024-4577","CVE-2024-8925","CVE-2024-8926","CVE-2024-8927","CVE-2024-9026","DSA-5780-1","GHSA-865W-9RF3-2WH5","GHSA-94P6-54JQ-9MWP","GHSA-9PQP-7H25-4F32","GHSA-P99J-RFP4-XQVQ","GHSA-VXPP-6299-MXW3"],"tags":["package-watch","pkg:php8.2","fix-available"],"cluster_id":375,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/483","html":"https://vulnwatch.ve1ve2.com/item/483"}},{"id":12668,"source":{"id":"gh-php-src","name":"PHP releases (GitHub php/php-src tags)"},"title":"GHSA-94p6-54jq-9mwp / CVE-2024-8927: cgi.force_redirect configuration is bypassable due to the environment variable collision","summary":"cgi.force_redirect configuration is bypassable due to the environment variable collision ### Summary According to , the configuration directive [`cgi.force_redirect`](https://www.php.net/manual/en/ini.core.php#ini.cgi.force-redirect) prevents anyone from calling PHP directly with a URL like `http://host.example/cgi-bin/php/secretdir/script.php`. The default value of `cgi.force_redirect` is `1`. But there is a bug that can cause attackers to bypass restrictions and access php-cgi directly. ### Details Both `REDIRECT_STATUS` or `HTTP_REDIRECT_STATUS` are considered legal environment variable while `cgi.force_redirect` is turned on: https://github.com/php/php-src/blob/master/sapi/cgi/cgi_main.c#L1905 ```c /* check force_cgi after startup, so we have proper output */ if (cgi && CGIG(force_redirect)) { /* Apache will generate REDIRECT_STATUS, * Netscape and redirect.so will generate HTTP_REDIRECT_STATUS. * redirect.so and installation instructions available from * http://www.koehntopp.de/php. * -- kk@netuse.de */ if (!getenv(\"REDIRECT_STATUS\") && !getenv (\"HTTP_REDIRECT_STATUS\") && /* this is to allow a different env var to be configured * in case some server does something different than above */ (!CGIG(redirect_status_env) || !getenv(CGIG(redirect_status_env))) ) { zend_try { SG(sapi_headers).http_response_code = 400; PUTS(\"Security Alert! The PHP CGI cannot be accessed directly.\\n\\n\\\n\nThis PHP CGI binary was compiled with force-cgi-redirect enabled. This\\n\\ means that a page will only be served up if the REDIRECT_STATUS CGI variable is\\n\\ set, e.g. via an Apache Action directive.\n\n\\n\\\n\nFor more information as to why this behaviour exists, see the \\ manual page for CGI security.\n\n\\n\\\n\nFor more information about changing this behaviour or re-enabling this webserver,\\n\\ consult the installation file that came with this distribution, or visit \\n\\ the manual page.\n\n\\n\"); } zend_catch { } zend_end_try(); #if defined(ZTS) && !defined(PHP_DEBUG) /* XXX we're crashing here in msvc6 debug builds at * php_message_handler_for_zend:839 because * SG(request_info).path_translated is an invalid pointer. * It still happens even though I set it to null, so something * weird is going on. */ tsrm_shutdown(); #endif free(bindpath); return FAILURE; } } ``` Unexpectedly, `Redirect-Status` header is converted to the `HTTP_REDIRECT_STATUS` environment variable, allowing the attacker to bypass the `cgi.force_redirect` variable through HTTP headers. ### Impact The `cgi.force_redirect` configuration can be bypassed. While this does not pose significant security risks in most common configurations, certain configurations that modifies the `SCRIPT_FILENAME` environment variable may allow the arbitrary file inclusion. Patched: 8.1.30, 8.2.24, 8.3.12","url":"https://github.com/php/php-src/security/advisories/GHSA-94p6-54jq-9mwp","published_at":"2024-09-27T17:51:24Z","updated_at":"2024-09-27T17:51:24Z","fetched_at":"2026-11-22T14:05:37.431197Z","severity":"high","cvss_score":7.5,"epss":0.01054,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php-src","vuln_id":"CVE-2024-8927","vuln_ids":["CVE-2024-8925","CVE-2024-8926","CVE-2024-8927","CVE-2024-9026","GHSA-94P6-54JQ-9MWP"],"tags":["repo-advisory","security","repo:php/php-src","stack"],"cluster_id":11777,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12668","html":"https://vulnwatch.ve1ve2.com/item/12668"}}]}