Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

ITS Advisory Number: 
2018-037
Date(s) Issued: 
Friday, March 30, 2018
Subject: 
Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution
Overview: 

Multiple vulnerabilities have been discovered in PHP, the most severe of which could allow an attacker to execute arbitrary code. PHP is a programming language originally designed for use in web-based applications with HTML content. PHP supports a wide variety of platforms and is used by numerous web-based software applications. Successfully exploiting the most severe of these vulnerabilities could allow for arbitrary code execution in the context of the affected application. Depending on the privileges associated with the application, an attacker could install programs; view, change, or delete data; or create new accounts with full user rights. Failed exploitation could result in a denial-of-service condition.

THREAT INTELLIGENCE:
There are currently no reports of this vulnerability being actively exploited in the wild.

Systems Affected: 

• PHP 7.2 prior to 7.2.4
• PHP 7.1 prior to 7.1.16
• PHP 7.0 prior to 7.0.29
• PHP 5.0 prior to 5.6.35

RISK
GOVERNMENT
Large and medium government entities: 
High
Small government entities: 
High
BUSINESS
Large and medium business entities: 
High
Small business entities: 
High
Home Users: 
Low
Description: 

Multiple vulnerabilities have been discovered in PHP, the most severe of which could allow an attacker to execute arbitrary code. Details of these vulnerabilities are as below:

Version 7.2.4
• Bug #62545 (wrong unicode mapping in some charsets).
• Bug #73957 (signed integer conversion in imagescale()).
• Bug #75605 (Dumpable FPM child processes allow bypassing opcache access controls).
• Bug #75867 (Freeing uninitialized pointer).
• Bug #75873 (pcntl_wexitstatus returns incorrect on Big_Endian platform (s390x)).
• Bug #75961 (Strange references behavior).
• Bug #75969 (Assertion failure in live range DCE due to block pass misoptimization).
• Bug #76025 (Segfault while throwing exception in error_handler).
• Bug #76041 (null pointer access crashed php).
• Bug #76044 ('date: illegal option -- -' in ./configure on FreeBSD).
• Bug #76068 (parse_ini_string fails to parse "[foo]\nbar=1|>baz"with segfault).
• Bug #76085 (Segmentation fault in buildFromIterator when directory name contains a \n).

Version 7.1.16
• Bug #76025 (Segfault while throwing exception in error_handler).
• Bug #76044 ('date: illegal option -- -' in ./configure on FreeBSD).
• Bug #75605 (Dumpable FPM child processes allow bypassing opcache access controls).
• Bug #73957 (signed integer conversion in imagescale()).
• Bug #76088 (ODBC functions are not available by default on Windows).
• Bug #76074 (opcache corrupts variable in for-loop).
• Bug #76085 (Segmentation fault in buildFromIterator when directory name contains a \n).
• Bug #74139 (mail.add_x_header default inconsistent with docs).
• Bug #76068 (parse_ini_string fails to parse "[foo]\nbar=1|>baz" with segfault).

Version 7.0.29
• Bug #75605 (Dumpable FPM child processes allow bypassing opcache access controls).

Version 5.6.35
• Bug #75605 (Dumpable FPM child processes allow bypassing opcache access controls).

Successfully exploiting the most severe of these vulnerabilities could allow for arbitrary code execution in the context of the affected application. Depending on the privileges associated with the application, an attacker could install programs; view, change, or delete data; or create new accounts with full user rights. Failed exploitation could result in a denial-of-service condition.

Actions: 

• After appropriate testing, immediately upgrade to the latest version of PHP.
• Verify no unauthorized system modifications have occurred on system before applying patch.
• Apply the principle of Least Privilege to all systems and services.
• Remind users not to visit websites or follow links provided by unknown or untrusted sources.

References: 

NOTE: Visiting these links may trigger an IDS signature match for a Possible Encrypted Webshell Download. This is a false positive alert that is matching content on the pages below.



PHP:
http://php.net/ChangeLog-7.php#7.2.4
http://php.net/ChangeLog-7.php#7.1.16
http://php.net/ChangeLog-7.php#7.0.29
http://php.net/ChangeLog-5.php#5.6.35