Skip to content
This repository was archived by the owner on May 16, 2018. It is now read-only.
This repository was archived by the owner on May 16, 2018. It is now read-only.

ZF-1.12.7 breaks code when using multi column ordering #378

@DragonBe

Description

@DragonBe

Last night we upgraded our codebases with the latest ZF1 version 1.12.7 which triggered all sorts of alarm bells. It took us about half a day to figure out why this was.

We have queries using multi-column ordering, which are now no longer functional because of the security fix ZF2014-04, as it was mentioned in the release notes:

ZF2014-04, which mitigates a potential SQL Injection (SQLi) vector when usiing ORDER BY clauses in Zend_Db_Select; SQL function calls were improperly detected, rendering ORDER clauses such as MD5(1);drop table foo unfiltered. The logic has been updated to prevent SQLi vectors, and users of this functionality are strongly encouraged to upgrade immediately.

Example Zend_Db_Select statements that fail now:

$select->order('productId ASC');
$select->product(array ('productId ASC', 'userId DESC'));

This code now translates into the following query

SELECT … ORDER BY 'productId ASC';

Which triggers the following MySQL errors:

Mysqli prepare error: Unknown column 'productId ASC'
Mysqli prepare error: Unknown column 'productId ASC, userId DESC'

I can imagine this is not the required result this fix should be!

We can't upgrade at this point.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions