首页> 外国专利> Cross-site request forgery defense

Cross-site request forgery defense

机译:跨站请求伪造防御

摘要

An HTML document includes a JavaScript element that manages CSRF token use. When the HTML document is rendered, the JavaScript element asynchronously requests a CSRF token from the server. In response, the server generates a JWT using a keyed HMAC algorithm. The resulting JWT, which functions as a CSRF token, is returned to the user where it is stored in a protected variable inside the JavaScript element. The CSRF token is therefore stateless and isn't stored in a server-side repository. When the user later requests access to a server resource, the CSRF token is included in such request. This may be accomplished by adding a hidden input field that includes the CSRF token to the submission that's transmitted to the server. If the server cannot validate the received token using the HMAC key that was originally used to generate the token, the request is considered unauthorized and is not processed.
机译:HTML文档包括管理CSRF令牌使用的JavaScript元素。呈现HTML文档时,JavaScript元素异步地从服务器请求CSRF令牌。作为响应,服务器使用键控HMAC算法生成JWT。生成的JWT(用作CSRF令牌)将返回给用户,并将其存储在JavaScript元素内的受保护变量中。因此,CSRF令牌是无状态的,不会存储在服务器端存储库中。当用户以后请求访问服务器资源时,CSRF令牌将包含在此请求中。这可以通过将包含CSRF令牌的隐藏输入字段添加到已传输到服务器的提交中来完成。如果服务器无法使用最初用于生成令牌的HMAC密钥验证接收到的令牌,则该请求将被视为未经授权,不会被处理。

著录项

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号