加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – Magento CSRF保护

发布时间:2020-12-13 18:05:43 所属栏目:PHP教程 来源:网络整理
导读:我正在寻找Magento的自定义表格.我看过这些教程 http://fastdivision.com/2012/03/29/diy-magento-create-ajax-login-registration-forms-for-your-magento-theme/ http://inchoo.net/ecommerce/magento/magento-email/magento-custom-email-contact-form-wi
我正在寻找Magento的自定义表格.我看过这些教程

http://fastdivision.com/2012/03/29/diy-magento-create-ajax-login-registration-forms-for-your-magento-theme/

http://inchoo.net/ecommerce/magento/magento-email/magento-custom-email-contact-form-with-notification-system/

我没有看到任何关于CSRF预防的提及,比如使用存储在用户会话中的客户端令牌来检查客户端令牌.我也查看了Magento联系我们表格,看到了这一点,但我不认为它与CSRF有关:

<input type="text" name="hideit" id="hideit" value="" style="display:none !important;">

Magento有没有防止CSRF的默认代码? Mage_Core_Controller_Front_Action的$this-> getRequest() – > getParams()方法是否自动执行任何操作以防止我可能缺少的CSRF?

最终程序员用户使用他们自己的CSFR / nonce保护方案,除非他们在后端管理控制台中创建页面/表单.默认情况下,Magento管理控制台应用程序对其所有页面/ URL都有此保护.

查看app / code / core / Mage / Adminhtml / Controller / Action.php中的_validateSecretKey和app / code / core / Mage / Adminhtml / Model / Url.php中的getSecretKey方法.这可以很容易地扩展到您自己在前端的表单.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读