cakephp - sql注入测试总是显示失败
我有使用 cakephp 1.3 开发的项目,为了测试我使用 SQL Inject me addon(firefox)
来自cakephp手册,我的理解是,保存( ) 和 find() 方法将自动保护数据免受 SQL 注入。但是在运行“SQL 注入我”测试时,我总是遇到失败。
例如:结果: 服务器状态代码:302 找到 测试值:1' AND 1=(SELECT COUNT(*) FROM tablenames); -- 服务器状态代码:302 找到 测试值:'; DESC 用户; -- 服务器状态代码:302 找到 测试值:1'1
我尝试过 cakephp santize 方法,然后我也收到“sql Inject me”中的错误。
有什么帮助吗?
示例代码
$this->data['User'] = Sanitize::clean($this->data['User'], array('encode' => false));
$this->User->save($this->data);
I have project developed using cakephp 1.3 and for testing I used SQL Inject me addon (firefox)
From cakephp manual, what I understood is, the save() and find() methods will automatically protect the data from SQL injection. But while running "SQL inject me" test, I am always getting failures as result.
For ex: Results:
Server Status Code: 302 Found
Tested value: 1' AND 1=(SELECT COUNT(*) FROM tablenames); --
Server Status Code: 302 Found
Tested value: '; DESC users; --
Server Status Code: 302 Found
Tested value: 1'1
I have tried with cakephp santize methods, then also I am getting the errors in "sql inject me".
Any help ?
Sample code
$this->data['User'] = Sanitize::clean($this->data['User'], array('encode' => false));
$this->User->save($this->data);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如何修复服务器Status Code: 302 Found by SQL Inject Me Firefox Addon
该错误表明 SQL 注入已被阻止。 SQL 注入不需要 Sanitize,但 XSS 需要 Sanitize。
How to fix Server Status Code: 302 Found by SQL Inject Me Firefox Addon
that error shows that the sql injection has been prevented. You don't need Sanitize for SQL injection, but for XSS.