Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

ITS Advisory Number: 
2017-118
Date(s) Issued: 
Thursday, November 30, 2017
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.1 prior to 7.1.12

  • PHP 7.0 prior to 7.0.26

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.1.12 

  • Bug (enchant_broker_get_path crashes if no path is set).
  • Bug (imagerotate may alter image dimensions).
  • Bug (Builtin webserver crash after chdir in a shutdown function).
  • Bug (Wrong reflection on inflate_init and inflate_add).
  • Bug (Exif extension has built in revision version).
  • Bug (Wrong reflection for openssl_open function).
  • Bug (UConverter::setDestinationEncoding changes source instead of destination).
  • Bug (openssl_x509_parse leaks memory).
  • Bug (Enchant still reports version 1.1.0).
  • Bug (mmap/munmap trashing on unlucky allocations).
  • Bug (Warning Internal error: wrong size calculation).
  • Bug (Default link incorrectly cleared/linked by pg_close()).
  • Bug (Crash when modifing property name in __isset for BP_VAR_IS).
  • Bug (Wrong reflection for mysqli_fetch_all function).
  • Bug (Wrong reflection on imagewebp).
  • Bug (Incorrect reflection for ibase_[p]connect).
  • Bug (Wrong reflection on SoapClient::__setSoapHeaders).
  • valgrind issue fixed.

Version 7.0.26

  • Bug (enchant_broker_get_path crashes if no path is set).
  • Bug (imagerotate may alter image dimensions).
  • Bug (Builtin webserver crash after chdir in a shutdown function).
  • Bug (Wrong reflection on inflate_init and inflate_add).
  • Bug (Exif extension has built in revision version).
  • Bug (Wrong reflection for openssl_open function).
  • Bug (UConverter::setDestinationEncoding changes source instead of destination).
  • Bug (openssl_x509_parse leaks memory).
  • Bug (Enchant still reports version 1.1.0).
  • Bug (mmap/munmap trashing on unlucky allocations).
  • Bug (Warning Internal error: wrong size calculation).
  • Bug (Default link incorrectly cleared/linked by pg_close()).
  • Bug (Crash when modifing property name in __isset for BP_VAR_IS).
  • Bug (Wrong reflection for mysqli_fetch_all function).
  • Bug (Wrong reflection on imagewebp).
  • Bug (Incorrect reflection for ibase_[p]connect).
  • Bug (Wrong reflection on SoapClient::__setSoapHeaders).
  • valgrind issue fixed.

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.1.12

http://php.net/ChangeLog-7.php#7.0.26