Description
PHP 5 before 5.2.7 does not properly initialize the page_uid and page_gid global variables for use by the SAPI php_getuid function, which allows context-dependent attackers to bypass safe_mode restrictions via variable settings that are intended to be restricted to root, as demonstrated by a setting of /etc for the error_log 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+lenny2 | DTSA-188-1, DSA-1789-1 |
| Debian 4.0 | php5 | 5.2.0+dfsg-8+etch15 | DSA-1789-1 |
Advisories 2
- DSA-1789-1 php5 - several vulnerabilities Debian Security (DSA / DLA) · Mar 9, 2026
- DTSA-188-1 php5 - several vulnerabilities Debian Security (DSA / DLA) · Mar 9, 2026
References
- HPSBUX02465 vendor-advisory
- SSRT090085 vendor-advisory
- 20090302 rPSA-2009-0035-1 php php-cgi php-imap php-mcrypt php-mysql php-mysqli php-pgsql php-soap php-xsl php5 php5-cgi php5-imap php5-mcrypt php5-mysql php5-mysqli php5-pear php5-pgsql php5-soap php5-xsl mailing-list
- php-getuid-safemode-bypass(47318) vdb-entry
- http://wiki.rpath.com/Advisories:rPSA-2009-0035
- 32688 vdb-entry
- 35003 third-party-advisory
- http://www.php.net/ChangeLog-5.php#5.2.7
- MDVSA-2009:045 vendor-advisory
- 50483 vdb-entry
- 20081205 PHP 5.2.6 SAPI php_getuid() overload third-party-advisory
- 52207 vdb-entry
- 20081206 SecurityReason: PHP 5.2.6 SAPI php_getuid() overload mailing-list
- 35650 third-party-advisory
- DSA-1789 vendor-advisory