Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

ITS Advisory Number: 
2018-047
Date(s) Issued: 
Friday, April 27, 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.

Systems Affected: 
  • PHP 7.2 prior to 7.2.5
  • PHP 7.1 prior to 7.1.17
  • PHP 7.0 prior to 7.0.30
  • PHP 5.0 prior to  5.6.36
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.5:

  • Bug (Convert valgrind detection to configure option).   
  • Bug (mismatch arginfo for date_create).
  • Bug (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value).   
  • Bug (ERROR: failed to reload: execvp() failed: Argument list too long).
  • Fixed incorrect write to getenv result in FPM reload.
  • Bug (imagedashedline() - dashed line sometimes is not visible).   
  • Bug (stream filter convert.iconv leads to infinite loop on invalid sequence).   
  • Bug (Intl compilation fails with icu4c 61.1).   
  • Bug (Malicious LDAP-Server Response causes Crash).   
  • Bug (Wrong cp1251 detection).
  • Bug (mbstring does not build with Oniguruma 6.8.1).   
  • Bug (ODBC functions are not available by default on Windows).   
  • Bug (Access violation when using opcache).   
  • Bug (fix for CVE-2018-5712 may not be complete).   
  • Bug (Memory corruption: arbitrary NUL overwrite).
  • Bug (mismatch arginfo for splarray constructor).
  • Bug (mail.add_x_header default inconsistent with docs).
  • Bug (incorrect url in header for mt_rand).

Version 7.1.17:

  • Bug (mismatch arginfo for date_create).
  • Bug#76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value).
  • Bug (ERROR: failed to reload: execvp() failed: Argument list too long).
  • Fixed incorrect write to getenv result in FPM reload.
  • Bug (imagedashedline() - dashed line sometimes is not visible).
  • Bug (stream filter convert.iconv leads to infinite loop on invalid sequence).
  • Bug (Intl compilation fails with icu4c 61.1).
  • Bug (Malicious LDAP-Server Response causes Crash).
  • Bug (Wrong cp1251 detection).
  • Bug (mbstring does not build with Oniguruma 6.8.1).
  • Bug (fix for CVE-2018-5712 may not be complete).
  • Bug (Memory corruption: arbitrary NUL overwrite).
  • Bug (mismatch arginfo for splarray constructor).
  • Bug (incorrect url in header for mt_rand). 

Version 7.0.30:

  • Bug (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value).
  • Bug (stream filter convert.iconv leads to infinite loop on invalid sequence).
  • Bug (Malicious LDAP-Server Response causes Crash).
  • Bug (fix for CVE-2018-5712 may not be complete).

Version 5.6.36: 

  • Bug (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value).
  • Bug (stream filter convert.iconv leads to infinite loop on invalid sequence).
  • Bug (Malicious LDAP-Server Response causes Crash).
  • Bug (fix for CVE-2018-5712 may not be complete).

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 immediately.
  • 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:

; text-decoration:underline">http://www.php.net/ChangeLog-7.php#7.2.5

; text-decoration:underline">http://www.php.net/ChangeLog-7.php#7.1.17

; text-decoration:underline">http://www.php.net/ChangeLog-7.php#7.0.30

; text-decoration:underline">http://www.php.net/ChangeLog-5.php#5.6.36