Multiple Vulnerabilities in PHP Could Allow for Arbitrary Code Execution

MS-ISAC ADVISORY NUMBER:

2018-046

DATE(S) ISSUED:

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

PHP 7.1 prior to 7.1.17

PHP 7.0 prior to 7.0.30

PHP 5.0 prior to 5.6.36

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

Bug #75722 (Convert valgrind detection to configure option).

Bug #76131 (mismatch arginfo for date_create).

Bug #76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value).

Bug #68440 (ERROR: failed to reload: execvp() failed: Argument list too long).

Fixed incorrect write to getenv result in FPM reload.

Bug #52070 (imagedashedline() - dashed line sometimes is not visible).

Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequence).

Bug #76153 (Intl compilation fails with icu4c 61.1).

Bug #76248 (Malicious LDAP-Server Response causes Crash).

Bug #75944 (Wrong cp1251 detection).

Bug #76113 (mbstring does not build with Oniguruma 6.8.1).

Bug #76088 (ODBC functions are not available by default on Windows).

Bug #76094 (Access violation when using opcache).

Bug #76129 (fix for CVE-2018-5712 may not be complete).

Bug #76143 (Memory corruption: arbitrary NUL overwrite).

Bug #76131 (mismatch arginfo for splarray constructor).

Bug #74139 (mail.add_x_header default inconsistent with docs).

Bug #75996 (incorrect url in header for mt_rand).

Version 7.1.17

Bug #76131 (mismatch arginfo for date_create).

Bug#76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value).

Bug #68440 (ERROR: failed to reload: execvp() failed: Argument list too long).

Fixed incorrect write to getenv result in FPM reload.

Bug #52070 (imagedashedline() - dashed line sometimes is not visible).

Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequence).

Bug #76153 (Intl compilation fails with icu4c 61.1).

Bug #76248 (Malicious LDAP-Server Response causes Crash).

Bug #75944 (Wrong cp1251 detection).

Bug #76113 (mbstring does not build with Oniguruma 6.8.1).

Bug #76129 (fix for CVE-2018-5712 may not be complete).

Bug #76143 (Memory corruption: arbitrary NUL overwrite).

Bug #76131 (mismatch arginfo for splarray constructor).

Bug #75996 (incorrect url in header for mt_rand).

Version 7.0.30

Bug #76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value).

Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequence).

Bug #76248 (Malicious LDAP-Server Response causes Crash).

Bug #76129 (fix for CVE-2018-5712 may not be complete).

Version 5.6.36

Bug #76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value).

Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequence).

Bug #76248 (Malicious LDAP-Server Response causes Crash).

Bug #76129 (fix for CVE-2018-5712 may not be complete).

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.

NOTE: Visiting these links may trigger an IDS signature match for a Possible Encrypted Webshell Download. This is a false positive alert that is matching content on the pages below.

REFERENCES: