Secunia Logo
Netsikker nu! 2008
 
PHP Multiple Vulnerabilities
Secunia Advisory: SA24089
Release Date: 2007-02-09
Last Update: 2007-04-12
Popularity: 17,191 views

Critical:
Moderately critical
Impact: Unknown
Security Bypass
Exposure of sensitive information
DoS
System access
Where: From remote
Solution Status: Vendor Patch

Software:PHP 4.4.x
PHP 5.2.x

Subscribe: Instant alerts on relevant vulnerabilities

CVE reference:CVE-2007-0905
CVE-2007-0906
CVE-2007-0907
CVE-2007-0908
CVE-2007-0909
CVE-2007-0910
CVE-2007-0988
CVE-2007-1286
CVE-2007-1375
CVE-2007-1380
CVE-2007-1383
CVE-2007-1376
CVE-2007-1452
CVE-2007-1453
CVE-2007-1454
CVE-2007-1824
CVE-2007-1825
CVE-2007-1884
CVE-2007-1887
CVE-2007-1888
CVE-2007-1889
CVE-2007-1890


Description:
Several vulnerabilities and a weakness have been reported in PHP, where some have unknown impacts and others can be exploited by malicious people to disclose potentially sensitive information, bypass certain security restrictions, cause a DoS (Denial of Service) and potentially compromise a vulnerable system.

1) The "safe_mode" and "open_basedir" protection mechanisms can be bypassed via the session extension.

2) Unspecified overflows can be exploited to cause a stack corruption in the session extension.

3) Buffer overflows, some of which are stack based, exist in the "zip", "imap", and "sqlite" (PHP 5) extensions.

4) A boundary error within the stream filters can be exploited to cause a buffer overflow.

5) An integer overflow exists in the "str_replace()" function. This can be exploited to trigger an error when allocating memory and potentially allow the execution of arbitrary code if the function is used on long, untrusted strings.

6) A boundary error in a call to "php_set_session_var()" when importing malicious WDDX data containing a numerical key can be exploited to disclose random memory.

7) An error due to 32 bit truncation in a helper function of the print() functions can lead to memory corruption or exploitable format string vulnerabilities on 64-bit systems.

8) Boundary errors exist within the "mail()", "ibase_add_user()", "ibase_delete_user()", and "ibase_modify_user()" functions, which can be exploited to cause buffer overflows.

9) A format string error exists in the "odbc_result_all()" function. Successful exploitation may allow the execution of arbitrary code, but requires that the attacker has control over the table contents of the used database.

10) An error within the "imap_mail_compose()" function can be exploited to cause a stack based buffer overflow and may allow the execution of arbitrary code if the function is used with untrusted input to create a new MIME message.

11) A weakness within the "zend_hash_init()" function on 64bit systems can be exploited to cause a DoS via CPU consumption until the script times out by triggering an infinite loop when unserializing untrusted data.

12) A vulnerability caused due to an integer overflow in the "unserialize()" function's handling of ZVAL structures can be exploited to corrupt memory and execute arbitrary code.

13) A boundary error in the session serialization handler "php_binary" can be exploited to expose heap memory.

14) Errors in the verification of resource types within the shared memory (shmop) functions can be exploited to read or write to arbitrary memory addresses.

15) A boundary error within the PHP 5 "zip" extension can be exploited to cause a stack-based overflow by passing an overly long string to the "zip:" URL wrapper. This may be related to vulnerability #3.

16) If the "FILTER_SANITIZE_STRING" filter of ext/filter is used in combination with the "FILTER_FLAG_STRIP_LOW " flag, the filtering mechanism can be bypassed via certain low ASCII characters after opening brackets to e.g. conduct cross-site scripting attacks.

17) The FDF (ext/fdf) extension does not correctly call input filtering hooks. If PHP is compiled with FDF support, this can be exploited to bypass the ext/filter input filtering mechanism by sending POST data in the application/vnd.fdf format.

18) A buffer underflow exists within the "FILTER_VALIDATE_INT" filter of the ext/filter extension. This can be exploited to execute arbitrary code, but may require a big-endian system.

19) An error in the "header()" function in PHP 5.2.0 when trimming whitespaces can be exploited to cause memory corruption and may allow execution of arbitrary code on a big-endian system.

20) An error in the session extension in the handling of hashtables can be exploited to replace the hashtable of session variables and allow execution of arbitrary code.

21) An error in the deserialisation of session data can be exploited to overwrite global variables (e.g. the "_SESSION" array) when "register_globals" is enabled.

22) An integer overflow error in the "zip_read_entry()" function in PHP4 can be exploited to cause a heap based buffer overflow by providing a length parameter of "-1". Successful exploitation may allow execution of arbitrary code.

23) An off-by-one error exists in the "php_stream_filter_create()" function (PHP 5) and can be exploited to to cause an off-by-one overflow e.g. via a "php://filter" URL.

24) An integer overflow error exists in the "msg_receive()" function and can be exploited to cause a buffer overflow via the "maxsize" parameter. Reportedly, the vulnerability does not affect PHP running on Linux systems, but e.g. PHP running on FreeBSD.

25) An error exists in the Zend Memory Manager in PHP 5.2.0 where a size value is cast to a signed long. This can be exploited to cause buffer overflows e.g. via the PHP HTTP SOAP client.

Other issues that may be security related have also been reported.

NOTE: Some issues can be triggered remotely under certain circumstances.

Solution:
Update to version 5.2.1 or 4.4.5.

Provided and/or discovered by:
1-5, 7-11) Reported by the vendor.
5, 6, 7, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25) Stefan Esser

Changelog:
2007-02-14: Added CVE reference.
2007-02-15: Updated "Solution" section. Added Information about PHP 4.
2007-02-20: Added CVE reference. Updated advisory with new information. Added vulnerabilities #10 and #11.
2007-03-05: Added vulnerabilities #12 and #13. Updated vulnerability #6.
2007-03-08: Added vulnerability #14.
2007-03-09: Added vulnerability #15. Added CVE reference.
2007-03-12: Added vulnerabilities #16, #17, and #18.
2007-03-14: Added CVE reference.
2007-03-19: Added vulnerability #19.
2007-03-21: Added CVE reference.
2007-03-26: Added vulnerability #20 and #21.
2007-03-28: Added vulnerability #22.
2007-04-02: Added vulnerability #23, #24, and #25. Updated Description. Added information for vulnerability #5, #7 and #10 provided by Stefan Esser. Added links to "Original Advisory" section.
2007-04-03: Added CVE reference.
2007-04-12: Added CVE reference.

Original Advisory:
http://www.php.net/releases/5_2_1.php
http://www.php.net/releases/4_4_5.php
5) http://www.php-security.org/MOPB/MOPB-41-2007.html
6) http://www.php-security.org/MOPB/MOPB-11-2007.html
7) http://www.php-security.org/MOPB/MOPB-38-2007.html
10) http://www.php-security.org/MOPB/MOPB-40-2007.html
12) http://www.php-security.org/MOPB/MOPB-04-2007.html
13) http://www.php-security.org/MOPB/MOPB-10-2007.html
14) http://www.php-security.org/MOPB/MOPB-15-2007.html
15) http://www.php-security.org/MOPB/MOPB-16-2007.html
16) http://www.php-security.org/MOPB/MOPB-18-2007.html
17) http://www.php-security.org/MOPB/MOPB-17-2007.html
18) http://www.php-security.org/MOPB/MOPB-19-2007.html
19) http://www.php-security.org/MOPB/MOPB-25-2007.html
20) http://www.php-security.org/MOPB/MOPB-30-2007.html
21) http://www.php-security.org/MOPB/MOPB-31-2007.html
22) http://www.php-security.org/MOPB/MOPB-35-2007.html
23) http://www.php-security.org/MOPB/MOPB-42-2007.html
24) http://www.php-security.org/MOPB/MOPB-43-2007.html
25) http://www.php-security.org/MOPB/MOPB-44-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. phpJobScheduler "installed_config_file" File Inclusion Vulnerabilities // 88 views
2. Apple Mac OS X Security Update Fixes Multiple Vulnerabilities // 34 views
3. Sun Java System Web Proxy Server FTP Subsystem Buffer Overflow // 34 views
4. CUPS Multiple Vulnerabilities // 30 views
5. CA ARCserve Backup Multiple Vulnerabilities // 29 views
6. Gentoo Portage Insecure Python Module Search Path Security Issue // 27 views
7. Symantec Norton AntiVirus MS-DOS Device Name Handling Weakness // 26 views
8. ScriptsEz Easy Image Downloader "id" File Disclosure Vulnerability // 23 views
9. Built2go Real Estate Listings "event_id" SQL Injection // 22 views
10. Fedora update for ruby // 22 views