cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[Vulnerability] PDO bindParams SQL injection

Open SliceOfLife opened this issue 13 years ago • 1 comments

echo $this->di->getShared('db')->bindParams('SELECT * FROM users WHERE login = :login: AND password = :password:', [
    'login' => ':password:',
    'password' => ' OR 1=1 -- a',
]);

This code makes the output:

SELECT * FROM users WHERE login = '' OR 1=1 -- a'' AND password = ' OR 1=1 -- a'

'db' object is an instance of \Phalcon\Db\Adapter\Pdo\Mysql.

SliceOfLife avatar Apr 23 '13 13:04 SliceOfLife

Thanks!, I removed this function in 1.1.0, this was only available for compatibility with 0.5.x

ghost avatar Apr 23 '13 14:04 ghost