热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Vulnerabilityfixes

Thispullrequestcomprisesofthefollowing1.DOM-basedXSSvulnerabilityfixes-

This pull request comprises of the following
1. DOM - based XSS vulnerability fixes - escapeHTML function was not used in some of the places. I have added it to the places where it was missed.
2. When the project is used under HTTPS by setting "use_tls" property to true in the config.json file, secure flag is set to true for the COOKIEs, and when used under HTTP, it is set to false.
3. Default expiration time for the COOKIE was 30 days. I have changed it to 5 days.
4. CSRF vulnerability & Insecure Direct object reference - I have duplicated the api routes separately for the browser. And i have modified all Javascript files to use the /browser routes instead of /api. This way, the /api routes continue to be csrfexempt, while the /browser routes are now under csrf protection. And since mid.RequireLogin is used by the /browser routes, in contrast to the mid.RequireAPIKey used by the /api routes. The /browser routes deduce the identity of the user from the HTTP request through the "id" value that is set in the COOKIEs rather than from the api_key being passed. This way, Insecure direct object reference also gets mitigated on the dashboard.

^^ Please NOTE that, this change doesn't touch the API layer at all.

该提问来源于开源项目:gophish/gophish

Looks good - thanks!





   



推荐阅读
author-avatar
羚瑞聪羊奶粉
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有