Secunia CSI 5.0
Overview
Advisories
Research
Forums
Create Profile
Our Commitment
Database
Search
Advisories by Product
Advisories by Vendor
Terminology
Report Vulnerability
Insecure Library Loading

Secunia Advisory SA18694

PHP "mb_send_mail()" and IMAP Functions Security Bypass
Secunia Advisory SA18694
Get alerted and manage the vulnerability life cycle
Free Trial

Release Date 2006-02-28
Last Update 2007-06-01
   
Popularity 15,692 views
Comments 0 comments

Criticality level Less criticalLess critical
Impact Security Bypass
Where Local system
Authentication level Available in Customer Area
   
Report reliability Available in Customer Area
Solution Status Unpatched
   
Systems affected Available in Customer Area
Approve distribution Available in Customer Area
Remediation status Secunia VIM
   
Software:
PHP 4.0.x
PHP 4.1.x
PHP 4.2.x
PHP 4.3.x
PHP 4.4.x
PHP 5.0.x
PHP 5.1.x

Secunia CVSS Score Available in Customer Area
CVE Reference(s) CVE-2006-1014 CVSS available in Customer Area
CVE-2006-1017 CVSS available in Customer Area
CVE-2006-1015 CVSS available in Customer Area
CVE-2006-7204 CVSS available in Customer Area
  

Description

Cdric Clerget has discovered two vulnerabilities in PHP, which can be exploited by malicious people to bypass certain security restrictions.

1) The PHP "mb_send_mail()" function allows additional parameters to be passed to sendmail via the "additional_parameter" parameter. This can be exploited to cause sendmail to read arbitrary files on the system as configuration file and saving the resulting log file to arbitrary writable directories. The saved log file may contain portions of the file that was read as configuration file.

Example:
$additional_param = "-C ".$file_to_read." -X ".getcwd()."/".$output_file;
mb_send_mail($email_address, NULL, NULL, NULL, $additional_param);

Successful exploitation allows the bypassing of certain "safe_mode" and "open_basedir" restrictions.

The vulnerability has been confirmed in version 5.1.2 and also reported in version 4.x. Other versions may also be affected.

2) The PHP imap functions e.g. "imap_open()", "imap_body()", and "imap_list()" can be exploited to read arbitrary files and obtain listings of arbitrary directories even when "safe_mode" and "open_basedir" are configured. It is reportedly also possible to create, delete, and rename files with apache privileges using the "imap_createmailbox()", "imap_deletemailbox()", and "imap_renamemailbox()" functions.

Successful exploitation allows bypassing of certain "safe_mode" and "open_basedir" restrictions.

The vulnerability has been confirmed in PHP version 4.4.2 compiled with c_client 2004g. Other versions may also be affected.


Solution
Do not compile PHP to enable support of the mbstring or imap functions if they are not required.

Provided and/or discovered by
Cdric Clerget

Changelog
Further details available in Customer Area

Deep Links
Links available in Customer Area


Do you have additional information related to this advisory?

Please provide information about patches, mitigating factors, new versions, exploits, faulty patches, links, and other relevant data by posting comments to this Advisory. You can also send this information to vuln@secunia.com

Subject: PHP "mb_send_mail()" and IMAP Functions Security Bypass
 
No posts yet

-

You must be logged in to post a comment.




 Products Solutions Customers Partner Resources Company
 
 Corporate
Vulnerability Intelligence Manager (VIM)
Corporate Software Inspector (CSI)
Consumer
Personal Software Inspector (PSI)
Online Software Inspector (OSI)
 Industry
Compliance
Technology
Integration
 Customers
Testimonials
 VARS
MSSP
Technology Partners
References
 Factsheets
Reports & Papers
Webinars
Events
 About us
Careers
Memberships
Newsroom


 
© 2002-2012 Secunia ApS - Rued Langgaards Vej 8, 4th floor, DK-2300 Copenhagen, Denmark - +45 7020 5144
Terms & Conditions and Copyright - Privacy - Report Vulnerability