CIS Logo
tagline: Confidence in the Connected World
HomeResourcesAdvisoriesMultiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

MS-ISAC ADVISORY NUMBER:

2018-023

DATE(S) ISSUED:

03/01/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.3
  • PHP 7.0 prior to 7.0.28
  • PHP 5.0 prior to 5.6.34
  • PHP 7.1 prior to 7.1.15

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

*Version 7.1.15
Bug #65414 (deal with leading slash when adding file).
Bug #49876 (Fix LDAP path lookup on 64-bit distros).s correctly).
Bug #68406 (calling vardump 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 (DNSCAA record results contain garbage).
Bug #75928 (Argument 2 for DateTimeZone::listIdentifiers() should accept null).
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.

RECOMENDATIONS:

We recommend the following actions be taken:

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