CVE-2007-1582

PHP 4.0.0-4.4.6 and 5.0.0-5.2.1 - Remote Code Execution via Userspace Error Handler

Title source: manual
STIX 2.1

Exploitation Summary

EIP tracks 1 public exploit for CVE-2007-1582. PoCs published by Stefan Esser.

AI-analyzed exploit summary This exploit leverages a use-after-free vulnerability in PHP's GD library to achieve remote code execution by overwriting memory structures and executing shellcode. It includes a bindshell payload and uses the substr_compare() vulnerability to calculate memory offsets dynamically.

Description

The resource system in PHP 4.0.0 through 4.4.6 and 5.0.0 through 5.2.1 allows context-dependent attackers to execute arbitrary code by interrupting certain functions in the GD (ext/gd) extension and unspecified other extensions via a userspace error handler, which can be used to destroy and modify internal resources.

Exploits (1)

exploitdb WORKING POC VERIFIED
by Stefan Esser · phplocallinux
https://www.exploit-db.com/exploits/3525

This exploit leverages a use-after-free vulnerability in PHP's GD library to achieve remote code execution by overwriting memory structures and executing shellcode. It includes a bindshell payload and uses the substr_compare() vulnerability to calculate memory offsets dynamically.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Complex
Reliability
Reliable
Target: PHP with GD library (versions affected by CVE-2007-1582)
No auth needed
Prerequisites: PHP with GD library enabled · Ability to execute arbitrary PHP code on the target system
devstral-2 · analyzed Feb 16, 2026 Full analysis →

References (4)

Core 4
Core References
Third Party Advisory, VDB Entry vdb-entry x_refsource_bid
http://www.securityfocus.com/bid/23046
Exploit, Third Party Advisory exploit x_refsource_exploit-db
https://www.exploit-db.com/exploits/3525
Vendor Advisory third-party-advisory x_refsource_secunia
http://secunia.com/advisories/24542
Vendor Advisory x_refsource_misc
http://www.php-security.org/MOPB/MOPB-27-2007.html

Scores

EPSS 0.0592
EPSS Percentile 92.3%

Details

Status published
Products (36)
php/php 4.0 (8 CPE variants)
php/php 4.0.0
php/php 4.0.1 (3 CPE variants)
php/php 4.0.2
php/php 4.0.3 (2 CPE variants)
php/php 4.0.4 (2 CPE variants)
php/php 4.0.5
php/php 4.0.6
php/php 4.0.7 (4 CPE variants)
php/php 4.1.0
... and 26 more
Published Mar 21, 2007
Tracked Since Feb 18, 2026