CVE-2009-4018

PHP <5.2.11 & 5.3.x <5.3.1 - Command Injection

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 1 public exploit for CVE-2009-4018. PoCs published by Hamid Ebadi.

AI-analyzed exploit summary This exploit bypasses PHP safe mode by leveraging a vulnerability in the `getuid` function to execute arbitrary shellcode or establish a reverse shell. It supports Linux and FreeBSD targets and can be used in RFI/LFI scenarios.

Description

The proc_open function in ext/standard/proc_open.c in PHP before 5.2.11 and 5.3.x before 5.3.1 does not enforce the (1) safe_mode_allowed_env_vars and (2) safe_mode_protected_env_vars directives, which allows context-dependent attackers to execute programs with an arbitrary environment via the env parameter, as demonstrated by a crafted value of the LD_LIBRARY_PATH environment variable.

Exploits (1)

exploitdb WORKING POC
by Hamid Ebadi · phpwebappsphp
https://www.exploit-db.com/exploits/11636

This exploit bypasses PHP safe mode by leveraging a vulnerability in the `getuid` function to execute arbitrary shellcode or establish a reverse shell. It supports Linux and FreeBSD targets and can be used in RFI/LFI scenarios.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: PHP 4.3.10 - 5.3.0
No auth needed
Prerequisites: PHP safe mode enabled · RFI/LFI vulnerability or direct script execution
devstral-2 · analyzed Feb 16, 2026 Full analysis →

References (16)

Core 16
Core References
Third Party Advisory third-party-advisory x_refsource_secunia
http://secunia.com/advisories/40262
Third Party Advisory, VDB Entry vdb-entry signature x_refsource_oval
https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A7256
Mailing List vendor-advisory x_refsource_hp
http://marc.info/?l=bugtraq&m=127680701405735&w=2
Patch mailing-list x_refsource_mlist
http://marc.info/?l=oss-security&m=125897935330618&w=2
Third Party Advisory third-party-advisory x_refsource_secunia
http://secunia.com/advisories/41490
Patch mailing-list x_refsource_mlist
http://www.openwall.com/lists/oss-security/2009/11/23/15
Various Sources vendor-advisory x_refsource_hp
http://www.itrc.hp.com/service/cki/docDisplay.do?docId=emr_na-c02512995
Vendor Advisory x_refsource_confirm
http://www.php.net/ChangeLog-5.php
Third Party Advisory, VDB Entry vdb-entry x_refsource_bid
http://www.securityfocus.com/bid/37138
Exploit, Patch x_refsource_confirm
http://bugs.php.net/bug.php?id=49026
Third Party Advisory third-party-advisory x_refsource_secunia
http://secunia.com/advisories/41480
Patch mailing-list x_refsource_mlist
http://marc.info/?l=oss-security&m=125886770008678&w=2
Vendor Advisory vendor-advisory x_refsource_mandriva
http://www.mandriva.com/security/advisories?name=MDVSA-2009:303

Scores

EPSS 0.1134
EPSS Percentile 95.4%

Details

CWE
CWE-264
Status published
Products (35)
php/php 1.0
php/php 2.0
php/php 2.0b10
php/php 3.0
php/php 3.0.1
php/php 3.0.2
php/php 3.0.3
php/php 3.0.4
php/php 3.0.5
php/php 3.0.6
... and 25 more
Published Nov 29, 2009
Tracked Since Feb 18, 2026