Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

ITS Advisory Number: 
2018-023 - UPDATED
Date(s) Issued: 
Thursday, March 1, 2018
Date Updated: 
Monday, March 5, 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.3
  • PHP 7.0 prior to 7.0.28
  • PHP 5.0 prior to 5.6.34

March 5th  – UPDATED SYSTEMS AFFECTED:

  • PHP 7.1 prior to 7.1.15

 

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.3:

  • Bug #49876 (Fix LDAP path lookup on 64-bit distros).
  • Bug #54289 (Phar::extractTo() does not accept specific directories to be extracted).
  • Bug #65414 (deal with leading slash when adding files correctly).
  • Bug #65414 (deal with leading slash while adding files correctly).
  • Bug #68406 (calling var_dump on a DateTimeZone object modifies it).
  • Bug #73725 (Unable to retrieve value of varchar(max) type).
  • Bug #74519 (strange behavior of AppendIterator).
  • Bug #75729 (opcache segfault when installing Bitrix).
  • Bug #75838 (Memory leak in pg_escape_bytea()).
  • Bug #75857 (Timezone gets truncated when formatted).
  • Bug #75864 ("stream_isatty" returns wrong value on s390x).
  • Bug #75871 (use pkg-config where available).
  • Bug #75882 (a simple way for segfaults in threadsafe php just with configuration).
  • Bug #75893 (file_get_contents $http_response_header variable bugged with opcache).
  • Bug #75916 (DNS_CAA record results contain garbage).
  • Bug #75928 (Argument 2 for `DateTimeZone::listIdentifiers()` should accept `null`).
  • Bug #75938 (Modulus value not stored in variable).
  • Bug #75981 (Prevent reading beyond buffer start in http wrapper).

Version 7.0.28:

  • Bug #75981 (stack-buffer-overflow while parsing HTTP response). 

Version 5.6.34:

  • Bug #75981 (stack-buffer-overflow while parsing HTTP response).

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.

March 5th – UPDATED DESCRIPTION:

Version 7.1.15 

  • Bug #49876 (Fix LDAP path lookup on 64-bit distros).
  • Bug #65414 (deal with leading slash when adding files correctly).
  • Bug #68406 (calling var_dump on a DateTimeZone object modifies it).
  • Bug #73725 (Unable to retrieve value of varchar(max) type).
  • Bug #74519 (strange behavior of AppendIterator).
  • Bug #75857 (Timezone gets truncated when formatted).
  • Bug #75871 (use pkg-config where available).
  • Bug #75882 (a simple way for segfaults in threadsafe php just with configuration).
  • Bug #75916 (DNS_CAA record results contain garbage).
  • Bug #75928 (Argument 2 for `DateTimeZone::listIdentifiers()` should accept `null`).
  • Bug #75981 (stack-buffer-overflow while parsing HTTP response).
Actions: 
  • Verify no unauthorized system modifications have occurred on system before applying patch.
  • After appropriate testing, immediately upgrade to the latest version of PHP.
  • 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.3

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

http://php.net/ChangeLog-5.php#5.6.34