是否有可能使ASP.NET MVC变化AntiForgeryToken值的每个经过验证? [英] Is it possible to make the AntiForgeryToken value in ASP.NET MVC change after each verification?

查看:109
本文介绍了是否有可能使ASP.NET MVC变化AntiForgeryToken值的每个经过验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们刚刚有一些渗透测试上,我们已经使用ASP.NET MVC构建的应用程序进行,那回来的建议之一是,AntiForgeryToken在表格的价值可能被重新提交多次,在单次使用后不到期。

We've just had some Penetration Testing carried out on an application we've built using ASP.NET MVC, and one of the recommendations that came back was that the value of the AntiForgeryToken in the Form could be resubmitted multiple times and did not expire after a single use.

根据<一href=\"http://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29_$p$pvention_Cheat_Sheet#General_Recommendation%3a_Synchronizer_Token_Pattern\"相对=nofollow> OWASP建议各地同步令牌格式:

一般情况下,开发人员只需要在当前会话生成此令牌一次。

这是我怎么想的ASP.NET MVC AntiForgeryToken工作。

Which is how I think the ASP.NET MVC AntiForgeryToken works.

在情况下,我们不得不投入战斗,是有可能导致AntiForgeryToken每个验证后重新生成新的价值?

In case we have to fight the battle, is it possible to cause the AntiForgeryToken to regenerate a new value after each validation?

推荐答案

该防伪标记只是一个反XSRF令牌。特别是,它是的不可以单次使用随机数。如果你需要一个一次性使用的随机数为您的应用程序,您不能使用防伪标记用于此目的。有没有内置的功能这一点。

The anti-forgery token is just an anti-XSRF token. In particular, it is not a single-use nonce. If you need a single-use nonce for your application, you cannot use the anti-forgery token for this purpose. There is no built-in functionality for this.

这篇关于是否有可能使ASP.NET MVC变化AntiForgeryToken值的每个经过验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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