2012-02-21 111 views
1

sql注入ZEND_DB_TABLE_ABSTRACT方法有可能吗?ZEND_DB_TABLE_ABSTRACT方法SQL注入

例如像

$this->insert(); 

编辑用于更清楚的解释

后的值是:

'username' = 'admin';

'password' = '1;Drop table users;'

这里是在控制器插入语句:

public function InsertAction() { 
    $postValues = $this->_request->getPost(); 
    $usersTable = new Application_Models_DbTable_Users(); 
    $username = $postValues['username']; 
    $password = $postValues['password']; 
    $data = array('username'=>$username,'password'=>$password); 
    $users->insert($data); 
} 
+0

你能更清楚你的代码和解释吗? – 2012-02-21 06:02:41

+0

如果您创建自己的“扩展Zend_Db_Table_Abstract”模型类,则可以添加任何您想要的方法 – max4ever 2012-02-21 08:44:45

回答

2

是的,这是可能的,但在insert()的通常用途是不可能的。除非您使用Zend_Db_Expr,否则您应该是安全的,因为insert()使用准备好的语句。其他方法和细节请参阅this post from Bill Karwin

0

检查了Zend Zend_Db_Table

的手工它会告诉你,你可以创建自己的方法谁。