PT-2024-40125 · Zend · Zend Db Select

Published

2024-06-07

·

Updated

2024-06-07

CVSS v3.1

9.8

Critical

VectorAV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions: Zend Db Select (affected versions not specified)
Description: The implementation of ORDER BY and GROUP BY in Zend Db Select is prone to SQL injection when a combination of SQL expressions and comments are used. This issue can be exploited by injecting malicious SQL code, such as MD5("a(");DELETE FROM p2; #), which can lead to unauthorized data modification or deletion. The vulnerability can be mitigated by properly filtering user input prior to invoking Zend Db.
Recommendations: To resolve the issue, developers should either never use user input for ORDER BY and GROUP BY operations or filter user input thoroughly prior to invoking Zend Db. Use the quoteInto() method to filter the input data, as shown in the example:
php
$db  = Zend Db::factory(...);
$input = "MD5("a(");DELETE FROM p2; #)"; 
$order = $db->quoteInto("SQL statement for ORDER", $input);

Fix

SQL injection

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

GHSA-6FQW-J3VM-7F66

Affected Products

Zend Db Select