PHP Multiple Code Execution Vulnerabilities
Secunia Advisory: SA24542
Release Date: 2007-03-16
Last Update: 2007-05-04
Popularity: 10,596 views

Critical:
Less critical
Impact: Exposure of sensitive information
Privilege escalation
Where: Local system
Solution Status: Partial Fix

Software:PHP 4.4.x
PHP 5.2.x

Subscribe: Instant alerts on relevant vulnerabilities

CVE reference:CVE-2007-1484
CVE-2007-1581
CVE-2007-1582
CVE-2007-1883


Description:
Stefan Esser has discovered some vulnerabilities and a weakness in PHP, which can be exploited by malicious users to disclose potentially sensitive information or to gain escalated privileges.

1) An error in the "array_user_key_compare()" function where key references are incorrectly destroyed can be exploited to cause memory corruption.

2) An error in the handling of resource data can be exploited to destroy and replace certain resources by interrupting the processing PHP function (e.g. functions of the GD extension). This allows read and write access to arbitrary memory addresses.

Successful exploitation of these vulnerabilities allows execution of arbitrary code, which can lead to security restrictions, such as the "disable_functions" directive, being bypassed.

3) An error in the handling of references in functions can be exploited to read arbitrary heap memory via a user space error handler interrupting e.g. the "iptcembed()" function.

The vulnerabilities are confirmed in version 5.2.1 and also reported in version 4.4.6. Other versions may also be affected.

Solution:
Update to version 5.2.2 or 4.4.7 to fix vulnerability #1. Grant only trusted users permissions to execute PHP code.

Provided and/or discovered by:
Stefan Esser

Changelog:
2007-03-20: Updated "Description" section and "Title". Added vulnerability #2.
2007-03-21: Added link to "Original Advisory" section.
2007-03-21: Added CVE reference.
2007-03-26: Added CVE reference.
2007-03-30: Updated "Description" section. Added weakness #3.
2007-04-12: Added CVE reference.
2007-05-04: Updated "Solution" section.

Original Advisory:
PHP:
http://www.php.net/releases/5_2_2.php
http://www.php.net/releases/4_4_7.php

MOPB:
1) http://www.php-security.org/MOPB/MOPB-24-2007.html

2) http://www.php-security.org/MOPB/MOPB-27-2007.html
http://www.php-security.org/MOPB/MOPB-28-2007.html

3) http://www.php-security.org/MOPB/MOPB-37-2007.html


Track this Secunia Advisory
Customers of the Secunia Vulnerability Intelligence solutions will automatically receive updates when new information regarding this advisory is released.

Read more about our Vulnerability Intelligence solutions and what they can do for you and your company.

About this Secunia Advisory
Please note: The information that this Secunia Advisory is based on comes from a third party unless stated otherwise.

Secunia collects, validates, and verifies all vulnerability reports issued by security research groups, vendors, and others.
  
Latest Advisories

Send Feedback to Secunia
If you have new information regarding this Secunia advisory or a product in our database, please send it to us using either our web form or email us at vuln@secunia.com.

Ideas, suggestions, and other feedback are most welcome.

Most Popular - 3 Hours

1. Subdreamer Light Global Variables SQL Injection Vulnerability // 74 views
2. Adobe Flash Player Multiple Vulnerabilities // 39 views
3. Microsoft Office Two Code Execution Vulnerabilities // 20 views
4. Microsoft Word Malformed Object Pointer Vulnerability // 19 views
5. Sun Java System Web Proxy Server SOCKS Module Buffer Overflows // 18 views
6. Sun Java JDK / JRE Multiple Vulnerabilities // 17 views
7. VLC Media Player Multiple Vulnerabilities // 17 views
8. phpBB "cur_password" Cross-Site Scripting Vulnerability // 16 views
9. Opera Multiple Vulnerabilities // 15 views
10. phpBB "gen_rand_string()" Predictable RNG Weakness // 12 views