Security Experts:

PHP 5 Updates Fix Several Vulnerabilities

Several security vulnerabilities affecting PHP were addressed last week with the release of versions 5.6.5, 5.5.21 and 5.4.37.

One of the flaws, an out-of-bounds read (CVE-2014-9427) that crashes php-cgi, was reported by Brian Carpenter.

“sapi/cgi/cgi_main.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,” reads a description of the issue in the National Vulnerability Database.

The NVD advisory notes that a remote attacker could exploit the vulnerability to “obtain sensitive information from php-cgi process memory by leveraging the ability to upload a .php file or trigger unexpected code execution if a valid PHP script is present in memory locations adjacent to the mapping.”

Another issue fixed in PHP 5.6.5, 5.5.21 and 5.4.37 is a use-after-free vulnerability in the unserialize() function that can be exploited by remote attackers to execute arbitrary code via a specially crafted unserialize call.

This security hole was reported in early December by German researcher Stefan Esser. The expert also provided a patch for the vulnerability (CVE-2014-8142). However, PHP developers made some changes to the patch submitted by Esser before integrating it in an update released in mid-December.

The researcher later discovered that the changes made the patch incomplete. The issue, to which a second CVE identifier has been assigned (CVE-2015-0231), has been properly addressed with the release of PHP 5.6.5, 5.5.21 and 5.4.37.

The latest version of PHP also fixes CVE-2015-0232, a security bug reported by Alex Eubanks.

According to SecurityTracker, “a user can create a JPEG file with a specially crafted EXIF tag that, when processed by the PHP application, will free an uninitialized pointer and potentially execute arbitrary code.”

PHP users are advised to install the latest versions as soon as possible. Additional details on the improvements and fixes in PHP 5.6.5, 5.5.21 and 5.4.37 are available in the changelog.

view counter
Eduard Kovacs (@EduardKovacs) is a contributing editor at SecurityWeek. He worked as a high school IT teacher for two years before starting a career in journalism as Softpedia’s security news reporter. Eduard holds a bachelor’s degree in industrial informatics and a master’s degree in computer techniques applied in electrical engineering.