CIS Logo
tagline: Confidence in the Connected World

Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

MS-ISAC ADVISORY NUMBER:

2019-016

DATE(S) ISSUED:

02/08/2019

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.15
  • PHP 7.3 prior to 7.3.2

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

  • Bug #77339 (callStatic may get incorrect arguments).
  • Bug #77494 (Disabling class causes segfault on member access).
  • Bug #77530 (PHP crashes when parsing (2)::class).
  • Bug #76675 (Segfault with H2 server push).
  • Bug #73281 (imagescale(…, IMGBILINEAR) can cause black border).
  • Bug #73614 (gdImageFilledArc() doesn't properly draw pies).
  • Bug #77272 (imagescale() may return image resource on failure).
  • Bug #77391 (1bpp BMPs may fail to be loaded).
  • Bug #77479 (imagewbmp() segfaults with very large images).
  • Bug #77440 (ldap_bind using ldaps or ldap_start_tls()=exception in libcrypto-1_1-x64.dll).
  • Bug #77454 (mb_scrub() silently truncates after a null byte).
  • Bug #75684 (In mysqlnd_ext_plugin.h the plugin methods family has no external visibility).
  • Bug #77361 (configure fails on 64-bit AIX when opcache enabled).
  • Bug #77390 (feof might hang on TLS streams in case of fragmented TLS records).
  • Bug #77273 (array_walk_recursive corrupts value types leading to PDO failure).
  • Bug #76839 (socket_recvfrom may return an invalid 'from' address on MacOS).
  • Bug #77395 (segfault about array_multisort).
  • Bug #77439 (parse_str segfaults when inserting item into existing array).****

Version 7.3.2

  • Bug #77369 (memcpy with negative length via crafted DNS response).
  • Bug #77387 (Recursion detection broken when printing GLOBALS).
  • Bug #77376 ("undefined function" message no longer includes namespace).
  • Bug #77357 (base64_encode / base64_decode doest not work on nested VM).
  • Bug #77339 (callStatic may get incorrect arguments).
  • Bug #77317 (DIR, FILE, realpath() reveal physical path for subst virtual drive).
  • Bug #77263 (Segfault when using 2 RecursiveFilterIterator).
  • Bug #77447 (PHP 7.3 built with ASAN crashes in zend_cpu_supports_avx2).
  • Bug #77484 (Zend engine crashes when calling realpath in invalid working dir).
  • Bug #76675 (Segfault with H2 server push).
  • Bug #77346 (webm files incorrectly detected as application/octet-stream).
  • Bug #77430 (php-fpm crashes with Main process exited, code=dumped, status=11/SEGV).
  • Bug #73281 (imagescale(…, IMGBILINEAR) can cause black border).
  • Bug #73614 (gdImageFilledArc() doesn't properly draw pies).
  • Bug #77272 (imagescale() may return image resource on failure).
  • Bug #77391 (1bpp BMPs may fail to be loaded).
  • Bug #77479 (imagewbmp() segfaults with very large images).
  • Bug #77440 (ldap_bind using ldaps or ldap_start_tls()=exception in libcrypto-1_1-x64.dll).
  • Bug #77428 (mb_ereg_replace() doesn't replace a substitution variable).
  • Bug #77454 (mb_scrub() silently truncates after a null byte).
  • Bug #77308 (Unbuffered queries memory leak).
  • Bug #75684 (In mysqlnd_ext_plugin.h the plugin methods family has no external visibility).
  • Bug #77266 (Assertion failed in dce_live_ranges).
  • Bug #77257 (value of variable assigned in a switch() construct gets lost).
  • Bug #77434 (php-fpm workers are segfaulting in zend_gc_addre).
  • Bug #77361 (configure fails on 64-bit AIX when opcache enabled).
  • Bug #77287 (Opcache literal compaction is incompatible with EXT opcodes).
  • Bug #77338 (get_browser with empty string).
  • Bug #77273 (array_walk_recursive corrupts value types leading to PDO failure).
  • Bug #77289 (PDO MySQL segfaults with persistent connection).
  • Bug #77410 (Segmentation Fault when executing method with an empty parameter).
  • Bug #76839 (socket_recvfrom may return an invalid 'from' address on MacOS).
  • Bug #77298 (segfault occurs when add property to unserialized empty ArrayObject).
  • Bug #77395 (segfault about array_multisort).
  • Bug #77439 (parse_str segfaults when inserting item into existing array).**

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.

RECOMMENDATIONS:

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 Control That Helps Avoid This Issue Arrow CIS Control 3: Continuous Vulnerability Assessment and Remediation

Information Hub : Advisories


CONTROL: 1 --- ADVISORY CONTROL: 0

Pencil Blog post 25 Apr 2019
CONTROL: 2 --- ADVISORY CONTROL: 0
CONTROL: 3 --- ADVISORY CONTROL: 0
CONTROL: 4 --- ADVISORY CONTROL: 0