CVE-2014-9427: Buffer Overflow
It was reported that a one byte file containing '#' and no newline causes php-cgi to segfault:
https://bugs.php.net/bug.php?id=68618
... $ printf "#" >crashme.php $ ./php-cgi crashme.php Segmentation fault ...
Upstream patch that fixes this issue: http://git.php.net/?p=php-src.git;a=commit;h=f9ad3086693fce680fbe246e4a45aa92edd2ac35
Other sources
sapi/cgi/cgimain.c in the CGI component in PHP through 5.4.36, 5.5.x through 5.5.20, and 5.6.x through 5.6.4, when mmap is used to read a .php file, does not properly consider the mapping's length during processing of an invalid file that begins with a # character and lacks a newline character, which causes an out-of-bounds read and might (1) allow remote attackers to obtain sensitive information from php-cgi process memory by leveraging the ability to upload a .php file or (2) trigger unexpected code execution if a valid PHP script is present in memory locations adjacent to the mapping.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/phpto a version that resolves this vulnerability.Fixed in 5.4.37 - Upgrade
Upgrade
redhat/phpto a version that resolves this vulnerability.Fixed in 5.5.21 - Upgrade
Upgrade
redhat/phpto a version that resolves this vulnerability.Fixed in 5.6.5 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch f9ad3086693fce680fbe246e4a45aa92edd2ac35
Event History
Frequently Asked Questions
What is the severity of CVE-2014-9427?
CVE-2014-9427 has been classified with a medium severity rating.
How do I fix CVE-2014-9427?
To fix CVE-2014-9427, you should upgrade PHP to version 5.4.36, 5.5.20, or 5.6.5 or later.
What systems are affected by CVE-2014-9427?
CVE-2014-9427 affects PHP versions 5.4.36, 5.5.x versions prior to 5.5.20, and 5.6.x versions prior to 5.6.5.
What kind of vulnerability is CVE-2014-9427?
CVE-2014-9427 is a denial of service vulnerability in the CGI component of PHP.
Can CVE-2014-9427 be exploited remotely?
Yes, CVE-2014-9427 can be exploited remotely if the vulnerable software is accessible over the network.