Description
The zend_restore_ini_entry_cb function in zend_ini.c in PHP 5.3.0, 5.2.10, and earlier versions allows context-specific attackers to obtain sensitive information (memory contents) and cause a PHP crash by using the ini_set function to declare a variable, then using the ini_restore function to restore the variable.
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 5.0 | php5 | 5.2.6.dfsg.1-1+lenny4 | DSA-1940-1 |
| Debian 4.0 | php5 | 5.2.0+dfsg-8+etch16 | DSA-1940-1 |
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 3
- PHP 5.2.10/5.3.0 - 'ini_restore()' Memory Information Disclosure EDB-10296 · local · Dec 3, 2009 · verified
- PHP 5.2.10/5.3 - 'ini_restore()' Memory Information Disclosure (1) EDB-33162 · remote · Aug 10, 2009 · verified
- PHP 5.2.10/5.3 - 'ini_restore()' Memory Information Disclosure (2) EDB-33163 · remote · Aug 10, 2009 · verified
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 1
- DSA-1940-1 php5 - multiple issues Debian Security (DSA / DLA) · Mar 9, 2026
References
- 37482 third-party-advisory
- DSA-1940 vendor-advisory
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=540605
- http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_ini.c?r1=272370&r2=284156
- 36009 vdb-entry
- 20090806 PHP 5.2.10/5.3.0 (zend_ini.c) Memory Disclosure third-party-advisory