Description
Integer overflow in the phar_parse_tarfile function in tar.c in the phar extension in PHP before 5.3.14 and 5.4.x before 5.4.4 allows remote attackers to cause a denial of service (application crash) or possibly execute arbitrary code via a crafted tar file that triggers a heap-based buffer overflow.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 6.0 | php5 | 5.3.3-7+squeeze13 | DSA-2492-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 6 | php +25 | 5.3.3-14.el6_3 | RHSA-2012:1046 |
| RHEL 5 | php53 +20 | 5.3.3-13.el5_8 | RHSA-2012:1047 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Exploit-DB 1
- PHP 'phar' Extension 1.1.1 - Heap Overflow EDB-17201 · dos · Apr 22, 2011
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 3
- RHSA-2012:1046 Red Hat Security Advisory: php security update Red Hat Security Advisories (RHSA) · Jun 28, 2026
- RHSA-2012:1047 Red Hat Security Advisory: php53 security update Red Hat Security Advisories (RHSA) · Jun 28, 2026
- DSA-2492-1 php5 - buffer overflow Debian Security (DSA / DLA) · Mar 9, 2026
References
- http://git.php.net/?p=php-src.git%3Ba=commit%3Bh=158d8a6b088662ce9d31e0c777c6ebe90efdc854
- https://bugzilla.redhat.com/show_bug.cgi?id=823594
- SUSE-SU-2012:0840 vendor-advisory
- https://bugs.php.net/bug.php?id=61065
- http://www.php.net/ChangeLog-5.php
- APPLE-SA-2012-09-19-2 vendor-advisory
- http://support.apple.com/kb/HT5501
- [oss-security] 20120522 Re: CVE request: PHP Phar - arbitrary code execution mailing-list
- http://0x1byte.blogspot.com/2011/04/php-phar-extension-heap-overflow.html