利用骨干网和Node.js的CSRF防御 [英] CSRF defense using backbone and node.js

查看:178
本文介绍了利用骨干网和Node.js的CSRF防御的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建使用骨干和node.js的一个网站,不要以为在默认情况下没有针对CSRF任何保护。有没有使用与骨干Node.js的打击时,CSRF项目的标准方式?
谢谢

I'm creating a website using backbone and node.js and don't think that by default there is any protection against CSRF. Is there a standard way to project against CSRF when using backbone with node.js? Thanks

推荐答案

您可以简单地确保请求具有 X-请求,通过标头值 XMLHTT prequest 。 AJAX请求有跨域限制,所以如果这个头是present它不是如隐藏窗体上的恶意网站。

You could simply ensure requests have the X-Requested-By header with the value XMLHTTPRequest. AJAX requests have cross-domain restrictions so if that header is present it was not e.g. a hidden form on a malicious website.

这篇关于利用骨干网和Node.js的CSRF防御的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆