-
Notifications
You must be signed in to change notification settings - Fork 802
Escaping DATE_FORMAT in "order" section of query REGRESSION #424
Comments
@druidvav Is using nested SQL functions. It seems to me that it's not even possible to detect this in a regular expression (which this feature relies upon):
Therefore nested SQL functions should have never been supported in the first place if the feature where implemented properly. |
Anyway, this is a major framework and you cannot just fix something and break backward compatibility with lots of projects in minor update and without proper announcement. |
The security advisory first mentioned in 1.12.7 that certain code should be fixed on the consumer side. Granted 1.2.7 would have run your code. In the announcment of 1.12.8 however, the full changelog also leads to #378 "ZF-1.12.7 breaks code when using multi column ordering". That's alarm bells for me... I've not made the upgrade yet. It's only out since yesterday anyway - the security threat is present but not too risky for a day (in our environment). In the long term, consumer side code must be fixed - because it's not a feature it's a security hole! I've made a regex to find all places in the code that need that fixing http://regex101.com/r/nK7yK3/2 _edit: updated regex_ |
This change is not only a security hole. It will lead us (and not only us, i suppose) to freeze our version to 1.12.7. I am not sure that we'll get the budget to fix this in really old and big project. |
@druidvav we also have fairly large projects running Is there another way around this issue? |
I've upgraded our projects today, here is another regex i used to find any suspicious SQL function usage: |
@druidvav I introduced a more restrictive regular expression in from(), group() and order() methods to prevent potential SQL injections, see the security advisory ZF2014-04. This restriction can be a potential BC break for complex SQL statement, like in you case where you have sub-functions. To avoid this problem you can use the |
After merging #418 we started reciving errors like that:
In previous versions DATE_FORMAT in order section worked properly, and now it is broken. I believe this is important regression and should be fixed ASAP.
The text was updated successfully, but these errors were encountered: