信息安全研究 ›› 2019, Vol. 5 ›› Issue (3): 223-229.

• 学术论文 • 上一篇    下一篇

基于MD5的CSRF防御模块的设计与实现

叶超   

  1. 四川大学计算机学院(软件学院)
  • 收稿日期:2019-03-12 出版日期:2020-03-15 发布日期:2019-03-12
  • 通讯作者: 叶超
  • 作者简介:叶超 1994年生,硕士研究生,主要研究方向为计算机网络与信息安全. chao_vici@163.com

Design and Implementation of CSRF Defense Module Based on MD5

  • Received:2019-03-12 Online:2020-03-15 Published:2019-03-12

摘要: 自20世纪90年代互联网向公众开放,使用互联网的人数激增,不论是生活、工作还是学习都与互联网密不可分.很多互联网服务与应用都是以Web形式提供给用户,所以Web应用程序的安全成为重中之重.其中跨站请求伪造(crosssite request forgery, CSRF)由于容易被忽略而被称为“沉睡的巨人”,其安全隐患较高.针对CSRF攻击模式,研究设计了一种基于MD5消息摘要算法的随机化参数名的CSRF防御模块,该模块主要利用Java过滤器Filter实现,通过为统一资源定位符号(URL)中的参数名称以及Form表单中的参数名称等添加由MD5消息摘要算法生成的随机参数,增加攻击者进行请求伪造的难度,而达到CSRF防御的目的,从而保障用户的安全.测试实验结果表明该方法效果较好,能有效防御CSRF攻击;增加该防御模块对Web服务器的性能影响较小并且在可接受范围内.

关键词: Web安全, 跨站请求伪造, MD5消息摘要算法, 随机化, 过滤器

Abstract: Since the 1990s, the Internet has been open to the public, and the number of people using the Internet has soared. Nowadays, the Internet is inseparable fromlife, work and study. Many Internet services and applications are available to users in the form of web pages. The security of web applications has become the most important thing.Among them, the security risk of CSRF (Cross-site request forgery) is high, which is called “the sleeping giant” because it's easy to be ignored. For the CSRF attack mode, This paper designs a CSRF defense module based on MD5 message digest algorithm to randomize the parameter names. Its mainly implemented by using a Java filter, and adding a random parameter generated by MD5 by parameter name in the uniform resource positioning symbol (URL) and the table form, which increase the difficulty of the attacker to request forgery, and achieve the purpose of CSRF defense to protect user’s security. The result of experiments demonstrates that the defend module is effective. It can effectively defend against CSRF attacks and increaseless impact of the defense module on the performance of the Web server within an acceptable range.

Key words: Web security, cross-site request forgery, MD5 message-digest algorithm, randomization, filter