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.
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
- Kolang 4.3.10 < 5.3.0 - 'proc_open()' PHP 'safe_mode' Bypass EDB-11636 · webapps · Mar 5, 2010
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
References
- 40262 third-party-advisory
- oval:org.mitre.oval:def:7256 vdb-entry signature
- HPSBUX02543 vendor-advisory
- http://svn.php.net/viewvc/php/php-src/branches/PHP_5_2/ext/standard/proc_open.c?r1=286360&r2=286359&pathrev=286360
- [oss-security] 20091123 Re: CVE request: php 5.3.1 - proc_open() bypass PHP Bug #49026 [was: Re: CVE request: php 5.3.1 update] mailing-list
- 41490 third-party-advisory
- [oss-security] 20091123 Re: CVE request: php 5.3.1 - proc_open() bypass PHP Bug #49026 [was: Re: CVE request: php 5.3.1 update] mailing-list
- HPSBMA02568 vendor-advisory
- http://www.php.net/ChangeLog-5.php
- 37138 vdb-entry
- http://bugs.php.net/bug.php?id=49026
- 41480 third-party-advisory
- [oss-security] 20091122 Re: CVE request: php 5.3.1 update mailing-list
- http://svn.php.net/viewvc/?view=revision&revision=286360
- http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/ext/standard/proc_open.c?r1=286360&r2=286359&pathrev=286360
- MDVSA-2009:303 vendor-advisory