CIS Logo
tagline: Confidence in the Connected World

Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

MS-ISAC ADVISORY NUMBER:

2018-136

DATE(S) ISSUED:

12/07/2018

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
Businesses:
  • Large and medium business entities: HIGH
  • Small business entities: HIGH
Home Users:
LOW

TECHNICAL SUMMARY:

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

Version 7.1.25

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

Version 7.0.33

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

Version 5.6.39

  • Bug #77020 (null pointer dereference in imap_mail).
  • Bug #77022 (PharData always creates new files with mode 0666).
  • Bug #77143 (Heap Buffer Overflow (READ: 4) in phar_parse_pharfile).
  • Bug #77153 (imap_open allows to run arbitrary shell commands via mailbox parameter).
  • Bug #77231 (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.

RECOMENDATIONS:

We recommend the following actions be taken:

  • Upgrade to the latest version of PHP immediately, after appropriate testing.
    o 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.

REFERENCES:

Get Email Updates When Cyber Threats Like This Arise

Arrow Subscribe to Advisories

Protect Your Systems from Cyber Threats Like This

CIS Controls That Help Avoid This Issue Arrow CIS Control 3: Continuous Vulnerability Assessment and Remediation Arrow CIS Control 18: Application Software Security