CIS Logo
tagline: Confidence in the Connected World

Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

MS-ISAC ADVISORY NUMBER:

2018-003

DATE(S) ISSUED:

01/08/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.1
  • PHP 7.1 prior to 7.1.13
  • PHP 7.0 prior to 7.0.27
  • PHP 5.0 prior to 5.6.33

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.1
Bug #64938 (libxml_disable_entity_loader setting is shared between requests).
Bug #73124 (php_ini_scanned_files() not reporting correctly).
Bug #73830 (Directory does not exist).
Bug #74183 (preg_last_error not returning error code after error).
Bug #74782 (remove file name from output to avoid XSS).
Bug #74862 (Unable to clone instance when private clone defined).
Bug #75074 (php-process crash when is_file() is used with strings longer 260 chars).
Bug #75384 (PHP seems incompatible with OneDrive files on demand).
Bug #75409 (accept EFAULT in addition to ENOSYS as indicator that getrandom() is missing).
Bug #75511 (fread not free unused buffer).
Bug #75514 (mt_rand returns value outside [$min,$max]+ on 32-bit) (Remi)
Bug #75525 (Access Violation in vcruntime140.dll).
Bug #75535 (Inappropriately parsing HTTP response leads to PHP segment fault).
Bug #75540 (Segfault with libzip 1.3.1).
Bug #75556 (Invalid opcode 138/1/1).
Bug #75570 ("Narrowing occurred during type inference" error).
Bug #75571 (Potential infinite loop in gdImageCreateFromGifCtx).
Bug #75573 (Segmentation fault in 7.1.12 and 7.0.26).
Bug #75574 (putenv does not work properly if parameter contains non-ASCII unicode character).
Bug #75579 (Interned strings buffer overflow may cause crash).
Bug #75608 ("Narrowing occurred during type inference" error).

Version 7.1.13
Bug #60471 (Random "Invalid request (unexpected EOF)" using a router script).
Bug #64938 (libxml_disable_entity_loader setting is shared between requests).
Bug #73124 (php_ini_scanned_files() not reporting correctly).
Bug #73830 (Directory does not exist).
Bug #74183 (preg_last_error not returning error code after error).
Bug #74782 (remove file name from output to avoid XSS).
Bug #74862 (Unable to clone instance when private clone defined).
Bug #75074 (php-process crash when is_file() is used with strings longer 260 chars).
Bug #75384 (PHP seems incompatible with OneDrive files on demand).
Bug #75409 (accept EFAULT in addition to ENOSYS as indicator that getrandom() is missing).
Bug #75511 (fread not free unused buffer).
Bug #75514 (mt_rand returns value outside [$min,$max]+ on 32-bit) (Remi)
Bug #75535 (Inappropriately parsing HTTP response leads to PHP segment fault).
Bug #75540 (Segfault with libzip 1.3.1).
Bug #75570 ("Narrowing occurred during type inference" error).
Bug #75571 (Potential infinite loop in gdImageCreateFromGifCtx).
Bug #75573 (Segmentation fault in 7.1.12 and 7.0.26).
Bug #75574 (putenv does not work properly if parameter contains non-ASCII unicode character).
Bug #75579 (Interned strings buffer overflow may cause crash).
Bug #75608 ("Narrowing occurred during type inference" error).

Version 7.0.27
Bug #60471 (Random "Invalid request (unexpected EOF)" using a router script).
Bug #64938 (libxml_disable_entity_loader setting is shared between requests).
Bug #74183 (preg_last_error not returning error code after error).
Bug #74782 (Reflected XSS in .phar 404 page).
Bug #75384 (PHP seems incompatible with OneDrive files on demand).
Bug #75409 (accept EFAULT in addition to ENOSYS as indicator that getrandom() is missing).
Bug #75535 (Inappropriately parsing HTTP response leads to PHP segment fault).
Bug #75540 (Segfault with libzip 1.3.1).
Bug #75571 (Potential infinite loop in gdImageCreateFromGifCtx).
Bug #75573 (Segmentation fault in 7.1.12 and 7.0.26).
Bug #75579 (Interned strings buffer overflow may cause crash).

Version 5.6.33
Bug #74782 (Reflected XSS in .phar 404 page).
Bug #75571 (Potential infinite loop in gdImageCreateFromGifCtx).

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