Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

ITS Advisory Number: 
2018-125
Date(s) Issued: 
Friday, December 7, 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 these vulnerabilities being exploited in the wild.

Systems Affected: 
  • PHP 7.2 prior to 7.2.13
  • PHP 7.1 prior to 7.1.25
  • PHP 7.0 prior to 7.0.33
  • PHP 5.6 prior to 5.6.39
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.13:

  • Bug (SoapClient can't handle object references correctly).
  • Bug (Validate length on socket_write).
  • Bug (WSDL_CACHE_MEMORY causes Segmentation fault).
  • Bug (PharData always creates new files with mode 0666).
  • Bug (pg_convert has a broken regex for the 'TIME WITHOUT TIMEZONE' data type).
  • Bug (Type inference in opcache causes side effects).
  • Bug (odbc_fetch_object has incorrect type signature).
  • Bug (array_diff_key() - segmentation fault).
  • Bug (slowness regression in 7.2/7.3 (compared to 7.1)).
  • Bug (php-win.exe corrupts unicode symbols from cli parameters).
  • Bug (Signedness issue in SOAP when precision=-1).
  • Bug (Heap Buffer Overflow (READ: 4) in phar_parse_pharfile).
  • Bug (Fixing 60494 ignored ICONV_MIME_DECODE_CONTINUE_ON_ERROR).
  • Bug (ftp_close(): SSL_read on shutdown).
  • Bug (imap_open allows to run arbitrary shell commands via mailbox parameter).
  • Bug (Segfault when using convert.quoted-printable-encode filter).

Version 7.1.25:

  • Bug (Validate length on socket_write).
  • Bug (zend_signal_startup() needs ZEND_API).
  • Bug (WSDL_CACHE_MEMORY causes Segmentation fault).
  • Bug (PharData always creates new files with mode 0666).
  • Bug (pg_convert has a broken regex for the 'TIME WITHOUT TIMEZONE' data type).
  • Bug (Type inference in opcache causes side effects).
  • Bug (odbc_fetch_object has incorrect type signature).
  • Bug (Signedness issue in SOAP when precision=-1).
  • Bug (Heap Buffer Overflow (READ: 4) in phar_parse_pharfile).
  • Bug (Fixing 60494 ignored ICONV_MIME_DECODE_CONTINUE_ON_ERROR).
  • Bug (ftp_close(): SSL_read on shutdown).
  • Bug (imap_open allows to run arbitrary shell commands via mailbox parameter).
  • Bug (Segfault when using convert.quoted-printable-encode filter).

Version 7.0.33:

  • Bug (Segfault when using convert.quoted-printable-encode filter).
  • Bug (null pointer dereference in imap_mail).
  • Bug (imap_open allows to run arbitrary shell commands via mailbox parameter).
  • Bug (PharData always creates new files with mode 0666).
  • Bug (Heap Buffer Overflow (READ: 4) in phar_parse_pharfile).

Version 5.6.39:

  • Bug (null pointer dereference in imap_mail).
  • Bug (PharData always creates new files with mode 0666).
  • Bug (Heap Buffer Overflow (READ: 4) in phar_parse_pharfile).
  • Bug (imap_open allows to run arbitrary shell commands via mailbox parameter).
  • Bug (Segfault when using convert.quoted-printable-encode filter).

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.
    • PHP versions 7.0.33 and 5.6.39 are the last scheduled updates for their respective branches. Consider migrating to 7.1 or 7.2.
  • 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.