GHSA-2x36-qhx3-7m5f
CRITICAL 9.8CVSS 3.1ZendFramework1 Potential SQL injection in the ORDER implementation of Zend_Db_Select
The implementation of the ORDER BY SQL statement in Zend_Db_Select of Zend Framework 1 contains a potential SQL injection when the query string passed contains parentheses.
For instance, the following code is affected by this issue:
$db = Zend_Db::factory( /* options here */ );
$select = $db->select()
->from(array('p' => 'products'))
->order('MD5(1); drop table products');
echo $select;
This code produce the string:
SELECT "p".* FROM "products" AS "p" ORDER BY MD5(1);drop table products ASC
instead of the correct one:
SELECT "p".* FROM "products" AS "p" ORDER BY "MD5(1);drop table products" ASC
The SQL injection occurs because we create a new Zend_Db_Expr() object, in presence of parentheses, passing directly the value without any filter on the string.
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | Packagist | zendframework/zendframework1 | >= 1.12.0, < 1.12.7 | 1.12.7 |
References
- https://framework.zend.com/security/advisory/ZF2014-04 · WEB
- https://github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zendframework1/ZF2014-04.yaml · WEB
- https://github.com/zendframework/zf1 · PACKAGE
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 7 Jun 2024)