A buffer overflow was reported in the apache_request_headers() function in PHP 5.4.x. The apache_request_headers() function has a loop that copies the name of an environment variable while it fixes cases and converts '_' to '-'. While this loop is supposed to only copy the variable name ("Cookie" from "HTTP_COOKIE"), it instead continues to the end of the entire environment variable. If the string being copied is longer than 128 bytes, it will overflow the buffer, resulting in a crash of the php interpretter. Statement: Not vulnerable. This issue did not affect the versions of PHP as shipped with Red Hat Enterprise Linux 4, 5, or 6. This flaw only affects PHP 5.4.0 through 5.4.2. External Reference: http://www.php.net/archive/2012.php#id2012-05-08-1
Created php tracking bugs for this issue Affects: fedora-17 [bug 820001]
Related upstream commits: http://git.php.net/?p=php-src.git;a=commitdiff;h=20364bcff9f38bed83245d785cc8ec3a072e4da5 http://git.php.net/?p=php-src.git;a=commitdiff;h=bd8912e47c8a74406fe49555a3eb76a8c3197b27 http://git.php.net/?p=php-src.git;a=commitdiff;h=1919ec5a55d971610eab86eb64b18b7eacfefe81 http://git.php.net/?p=php-src.git;a=commitdiff;h=057f4719d3825fff3f0cfe0f263168b227d93205 Upstream bug (currently non-public): https://bugs.php.net/bug.php?id=61807
This flaw affects PHP-CGI. Common configurations using Apache httpd PHP module, which is also the default setting in Fedora and Red Hat Enterprise Linux, were not affected by this flaw.