7.5
EPSS
0.084%
Advisory Published
CVE Published
Updated

CVE-2024-8927: cgi.force_redirect configuration is bypassable due to the environment variable collision

First published: Thu Sep 26 2024(Updated: )

According to <a href="https://www.php.net/manual/en/security.cgi-bin.force-redirect.php">https://www.php.net/manual/en/security.cgi-bin.force-redirect.php</a>, the configuration directive cgi.force_redirect prevents anyone from calling PHP directly with a URL like <a href="http://host.example/cgi-bin/php/secretdir/script.php">http://host.example/cgi-bin/php/secretdir/script.php</a>. 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.

Credit: security@php.net security@php.net

Affected SoftwareAffected VersionHow to fix
Php-fpm Php-fpm>=8.1.0<8.1.30
Php-fpm Php-fpm>=8.2.0<8.2.24
Php-fpm Php-fpm>=8.3.0<8.3.12
debian/php7.4<=7.4.33-1+deb11u5
7.4.33-1+deb11u7
debian/php8.2
8.2.26-1~deb12u1
8.2.27-1
PHP<8.3.12
8.3.12

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is the severity of CVE-2024-8927?

    CVE-2024-8927 has a high severity due to its potential to allow unauthorized access to PHP scripts.

  • How do I fix CVE-2024-8927?

    To fix CVE-2024-8927, update PHP to versions 8.3.12, 8.2.26-1~deb12u1, or 8.2.27 as appropriate.

  • Which versions of PHP are affected by CVE-2024-8927?

    CVE-2024-8927 affects PHP versions from 8.1.0 to 8.1.30, 8.2.0 to 8.2.24, and from 8.3.0 to 8.3.12.

  • What configuration settings can mitigate CVE-2024-8927?

    Setting cgi.force_redirect to a value that restricts access can mitigate the risks associated with CVE-2024-8927.

  • Is CVE-2024-8927 related to other PHP vulnerabilities?

    Yes, CVE-2024-8927 is related to previous vulnerabilities affecting PHP’s handling of CGI scripts.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203