🛡️ GHSA-6fqw-j3vm-7f66 — zendframework1
Description
Zendframework1 Potential SQL injection in ORDER and GROUP functions
The implementation of ORDER BY and GROUP BY in Zend_Db_Select remained prone to SQL injection when a combination of SQL expressions and comments were used. This security patch provides a comprehensive solution that identifies and removes comments prior to checking validity of the statement to ensure no SQLi vectors occur.
The implementation of ORDER BY and GROUP BY in Zend_Db_Select of ZF1 is vulnerable by the following SQL injection:
```
$db = Zend_Db::factory(/* options here */);
$select = new Zend_Db_Select($db);
$select->from('p');
$select->order("MD5(\"a(\");DELETE FROM p2; #)"); // same with group()
```
The above $select will render the following SQL statement:
```
SELECT p.* FROM p ORDER BY MD5("a(");DELETE FROM p2; #) ASC
```
instead of the correct one:
```
SELECT "p".* FROM "p" ORDER BY "MD5(""a("");DELETE FROM p2; #)" ASC
```
This security fix can be considered an improvement of the previous ZF2016-02 and ZF2014-04 advisories.
As a final consideration, we recommend developers either never use user input for these operations, or filter user input thoroughly prior to invoking Zend_Db. You can use the Zend_Db_Select::quoteInto() method to filter the input data, as shown in this example:
```
$db = Zend_Db::factory(...);
$input = "MD5(\"a(\");DELETE FROM p2; #)"; // user input can be an attack
$order = $db->quoteInto("SQL statement for ORDER", $input);
$select = new Zend_Db_Select($db);
$select->from('p');
$select->order($order); // same with group()
```
How this vulnerability can be exploited
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability high.
Weakness class
GHSA-6fqw-j3vm-7f66 is classified as CWE-89: SQL Injection. Untrusted input is concatenated into an SQL statement, letting an attacker change the query and reach data the request should not return.
Affected software
GHSA-6fqw-j3vm-7f66 is recorded against 1 package.
- zendframework/zendframework1 (fixed in 1.12.20)
Timeline and source
Published on 7 June 2024 and last revised on 4 December 2024. No public exploit is currently recorded for this entry. Record sourced from OSV.
References
framework.zend.com (Web)
github.com (Web)
github.com (Package)
Details
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| zendframework/zendframework1 | — | 1.12.20 |
References
Similar Threats
- Unknown CLSA-2026-1771548781
- Unknown CLSA-2026-1777855982
- High GHSA-229x-22xc-2f2w
- High GHSA-2jx7-xg83-j2m7
- Critical GHSA-2x36-qhx3-7m5f
Exploit Protection
Are you running zendframework1?
GHSA-6fqw-j3vm-7f66 carries CVSS 9.5 Critical rating. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.
Check My Site For GHSA-6fqw-j3vm-7f66 →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.