Title: PHP MySQLI Error Logging Remote Format String Vulnerability
Severity: HIGH
Description:
PHP is a free and widely used Web page development language.
PHP is susceptible to a remote format string vulnerability in the 'mysqli' extension. This issue is due to a failure of the application to properly sanitize user-supplied input prior to using it in the format-specifier argument to a formatted printing function.
The 'ext/mysqli' module started using PHP's exception handling support to implement error logging. This code was introduced in PHP 5.1. This module improperly utilizes user-supplied data in the generated error messages without prior sanitization of format-specifier '%' sequences.
The error messages that are affected by this issue are generated by the MySQL client library, or the MySQL server, and there are a number of methods that an attacker may use to create error messages with attacker-supplied data.
One such method to control the error string would be to include malicious data in the hostname argument to the MySQL connection string. It should be noted that this argument is not usually accessible for modification by remote attackers. This may limit the possible exploitation to legitimate users and administrators in a shared hosting environment.
Another method to control the error string would be to control the MySQL server that the affected PHP interpreter attempts to connect to. This would limit exploitation to the administrators of the remote MySQL server.
If PHP is configured to log failed SQL queries, attackers may exploit latent SQL injection vulnerabilities in Web applications to include sufficient data in the error log to exploit this format string vulnerability.
This issue allows attackers to execute arbitrary machine code in the context of the Web server hosting the PHP interpreter.
This issue affects PHP 5.1.0, and 5.1.1.
Affected Products:
- PHP PHP 5.1.0
- PHP PHP 5.1.1
References:
- PHP: PHP 5.1.2. Release Announcement
- PHP: PHP Homepage
Juniper Networks provides this content via a wide variety of sources and production methods. If notified of errors or omissions in the content of this page, Juniper Networks, at its discretion, will modify or remove the page or leave the content as is, depending on various factors including but not limited to the reputation and authority of the party providing the notification. Please use the contact information displayed elsewhere on this page to report any errors or omissions regarding the content on this page.