You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL injection fix: Cast limit to integer when setting via Criteria::setLimit() (#1465)
* Cast limit to integer when setting via Criteria::setLimit()
This is a followup to a fix for SQL injections with LIMIT clauses in MySQL [1]. That fix only applied to the MySQL adapter, and other existing or future adapters could still be at risk.
By coercing limit inputs to integers upon setting them, we can avoid SQL injection vulnerabilities with `limit()` across all database adapters.
The original code comments implied that integer coercion could be problematic with 32-bit integers, but unit tests in this PR prove otherwise. Even 64-bit integers seem to work fine.
[1] #1464
* Add missing tests for setOffset()
* Remove note about 32-bit truncation
Unit tests show that even 64-bit integers aren't truncated.
0 commit comments