PhalconPHP - 保护在数据库中创建记录
PhalconPHP - Securing creating record in database
我有一个关于如何创建用户传递的表单数据的安全记录的问题。是:
$account = new Accounts();
$account->email = $parserData['email'];
$account->password = $parserData['password'];
$account->save();
安全还是我应该自己验证(或以某种方式使用绑定)每条数据?我找不到关于 sql 在 phalcon 网站上提供的模型教程中创建记录并提供参考的注入的答案。
SQL 注入在核心中被阻止,你应该散列密码并且(可选)检查 'email' 和 'password' 是否是字符串因为 XSS ,我打开了一个问题这是前一段时间:
https://github.com/phalcon/cphalcon/issues/2756
另见:
https://docs.phalconphp.com/en/latest/reference/security.html
http://phalcontip.com/discussion/24/harden-the-password-hashing
https://docs.phalconphp.com/en/latest/reference/crypt.html
Phalcon 使用预处理语句,因此您无需担心在分配变量时是否正确转义。
我有一个关于如何创建用户传递的表单数据的安全记录的问题。是:
$account = new Accounts();
$account->email = $parserData['email'];
$account->password = $parserData['password'];
$account->save();
安全还是我应该自己验证(或以某种方式使用绑定)每条数据?我找不到关于 sql 在 phalcon 网站上提供的模型教程中创建记录并提供参考的注入的答案。
SQL 注入在核心中被阻止,你应该散列密码并且(可选)检查 'email' 和 'password' 是否是字符串因为 XSS ,我打开了一个问题这是前一段时间: https://github.com/phalcon/cphalcon/issues/2756
另见: https://docs.phalconphp.com/en/latest/reference/security.html http://phalcontip.com/discussion/24/harden-the-password-hashing https://docs.phalconphp.com/en/latest/reference/crypt.html
Phalcon 使用预处理语句,因此您无需担心在分配变量时是否正确转义。