CVE-2015-5589
Critical · 9.8CVSS
9.8
EPSS
6.3%
Published
May 16, 2016
CISA due date
—
Cloudanix analysis
Older PHP software can crash or behave unexpectedly when it tries to handle certain specially made archive files, potentially disrupting websites and services.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Improper Input Validation
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The phar_convert_to_other function fails to validate a file pointer before performing a close operation, allowing a crafted TAR archive supplied to Phar::convertToData to trigger a segmentation fault or other unspecified memory corruption.
Why it matters to the business
Web applications and services built on vulnerable PHP versions can experience sudden crashes or unpredictable behavior when processing untrusted archives, leading to service outages and potential data exposure or code execution in worst cases.
How an attack unfolds
An attacker creates a specially malformed TAR archive and causes a PHP application to invoke Phar::convertToData on it, either directly through file upload or indirectly via library code that processes archives; the missing pointer validation then dereferences invalid memory.
How to fix it
Upgrade PHP to version 5.4.43, 5.5.27, or 5.6.11 or later. Disable Phar functionality if the feature is unused. Apply vendor-supplied patches for any downstream distributions.
How to confirm the fix worked
Confirm the installed PHP version is at or above the fixed releases; attempt to reproduce the crash with a known-bad TAR archive in a controlled test environment; review phar_object.c source to verify the pointer check is present.
Typical attack path
- Craft a malicious TAR archive that triggers the pointer mishandling path
- Deliver the archive to a PHP application via upload, include, or automated processing
- Invoke Phar::convertToData on the archive through normal application logic
- Trigger segmentation fault or memory corruption in the PHP process
How to detect it
Search PHP error logs and system crash reports for segmentation faults originating from ext/phar/phar_object.c or phar_convert_to_other; correlate spikes in application crashes with archive-processing endpoints.
What your security team should do
- Prioritize upgrade of all PHP installations to patched releases
- Inventory applications that use Phar or TAR handling and restrict untrusted archive processing
- Enable PHP error logging and monitor for segmentation faults
- Apply web application firewall rules that block or sanitize archive uploads where feasible
The record
The phar_convert_to_other function in ext/phar/phar_object.c in PHP before 5.4.43, 5.5.x before 5.5.27, and 5.6.x before 5.6.11 does not validate a file pointer before a close operation, which allows remote attackers to cause a denial of service (segmentation fault) or possibly have unspecified other impact via a crafted TAR archive that is mishandled in a Phar::convertToData call.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:6.0 | php5 | 0 | 5.3.3.1-7+squeeze27 |
| Debian:7 | php5 | 0 | 5.4.44-0+deb7u1 |
| Debian:8 | php5 | 0 | 5.6.12+dfsg-0+deb8u1 |
| Mageia:4 | php | 0 | 5.5.27-1.mga4 |
| Mageia:4 | php-apc | 0 | 3.1.15-4.17.mga4 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-bcmath | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-cli | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-common | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-dba | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-dbg | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-debuginfo | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-devel | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-embedded | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-enchant | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-fpm | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-gd | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-gmp | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-imap | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-intl | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-ldap | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-mbstring | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-mysqlnd | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-odbc | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-opcache | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-pdo | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-pgsql | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-process | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-pspell | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-recode | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-snmp | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-soap | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-tidy | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-xml | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el6 | rh-php56-php-xmlrpc | 0 | 0:5.6.5-8.el6 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-bcmath | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-cli | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-common | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-dba | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-dbg | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-debuginfo | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-devel | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-embedded | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-enchant | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-fpm | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-gd | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-gmp | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-intl | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-ldap | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-mbstring | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-mysqlnd | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-odbc | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-opcache | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-pdo | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-pgsql | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-process | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-pspell | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-recode | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-snmp | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-soap | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-xml | 0 | 0:5.6.5-8.el7 |
| Red Hat:rhel_software_collections:2::el7 | rh-php56-php-xmlrpc | 0 | 0:5.6.5-8.el7 |
| SUSE:Linux Enterprise Module for Web and Scripting 12 | php5 | 0 | 5.5.14-33.2 |
| SUSE:Linux Enterprise Server 11 SP2-LTSS | php53 | 0 | 5.3.17-47.1 |
| SUSE:Linux Enterprise Server 11 SP3 | php53 | 0 | 5.3.17-45.1 |
| SUSE:Linux Enterprise Server 11 SP3-TERADATA | php53 | 0 | 5.3.17-45.1 |
| SUSE:Linux Enterprise Server 11 SP4 | php53 | 0 | 5.3.17-45.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP3 | php53 | 0 | 5.3.17-45.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | php53 | 0 | 5.3.17-45.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP3 | php53 | 0 | 5.3.17-45.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | php53 | 0 | 5.3.17-45.1 |
| SUSE:Linux Enterprise Software Development Kit 12 | php5 | 0 | 5.5.14-33.2 |
| Ubuntu:14.04:LTS | php5 | 0 | 5.5.9+dfsg-1ubuntu4.13 |
Related vulnerabilities
- CVE-2015-6834 Multiple use-after-free vulnerabilities in PHP before 5.4.45, 5.5.x before 5.5.29, and… Also affects php5
- CVE-2015-4643 Integer overflow in the ftp_genlist function in ext/ftp/ftp.c in PHP before 5.4.42, 5.5.x… Also affects php5
- CVE-2015-4602 The __PHP_Incomplete_Class function in ext/standard/incomplete_class.c in PHP before… Also affects php5
- CVE-2015-4600 The SoapClient implementation in PHP before 5.4.40, 5.5.x before 5.5.24, and 5.6.x before… Also affects php5
- CVE-2015-4599 The SoapFault::__toString method in ext/soap/soap.c in PHP before 5.4.40, 5.5.x before… Also affects php5
- CVE-2015-3411 PHP before 5.4.40, 5.5.x before 5.5.24, and 5.6.x before 5.6.8 does not ensure that… Also affects php5
- CVE-2015-6836 The SoapClient __call method in ext/soap/soap.c in PHP before 5.4.45, 5.5.x before… Also affects php5
- CVE-2015-7803 The phar_get_entry_data function in ext/phar/util.c in PHP before 5.5.30 and 5.6.x before… Also affects php5