CVE-2015-7695: Zend Framework SQL Injection in PDO Adapter
Summary
CVE-2015-7695: Zend Framework SQL injection vector using null byte for PDO. Affects zendframework/zendframework1 versions < 1.12.16. Fixed in 1.12.16. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Zend Framework is a popular open-source PHP framework that provides a collection of professional PHP packages. It offers a robust and scalable platform for developing web applications. The vulnerability in question affects the PDO adapters in Zend Framework versions prior to 1.12.16. PDO adapters are responsible for connecting to databases and executing SQL statements. This vulnerability allows remote attackers to execute arbitrary SQL commands by exploiting a SQL injection vector that utilizes null bytes in PDO queries.
Vulnerability Detail
The vulnerability arises from the lack of null byte filtering in SQL statements within the PDO adapters of Zend Framework. This oversight enables attackers to inject malicious SQL commands into crafted queries. By exploiting this vulnerability, remote attackers can execute arbitrary SQL commands, potentially leading to unauthorized access, data manipulation, or even complete compromise of the affected system.
How To Fix
Minimum fixed version
1.12.16
This is the first release that contains the fix.
composer require zendframework/zendframework1:1.12.16
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, developers can manually filter null bytes in SQL statements before executing them. This can be achieved by using appropriate sanitization techniques or by implementing prepared statements with parameter binding. Here is an example of using prepared statements with parameter binding in PHP:
$pdo = new PDO($dsn, $username, $password);
$stmt = $pdo->prepare('SELECT * FROM users WHERE username = :username');
$stmt->bindParam(':username', $username);
$stmt->execute();
$result = $stmt->fetchAll();
Conclusion
The vulnerability in the PDO adapters of Zend Framework versions prior to 1.12.16 allows remote attackers to execute arbitrary SQL commands. To mitigate this vulnerability, it is recommended to upgrade to Zend Framework version 1.12.16 or later. Developers can also implement temporary workarounds such as manually filtering null bytes or using prepared statements with parameter binding. For further assistance with vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for zendframework/zendframework1 →
FAQ
This vulnerability allows remote attackers to execute arbitrary SQL commands, potentially leading to unauthorized access, data manipulation, or complete compromise of the affected system.
The vulnerability affects Zend Framework versions prior to 1.12.16.
While specific exploits targeting this vulnerability may exist, there are no publicly known exploits at the time of this report.
Yes, upgrading to Zend Framework version 1.12.16 or later resolves this vulnerability.
As a temporary workaround, developers can manually filter null bytes in SQL statements or implement prepared statements with parameter binding.
Related vulnerabilities
Recent vulnerabilities recorded for zendframework/zendframework1.