otale / tale

🦄 Best beautiful java blog, worth a try
https://tale.biezhi.me
MIT License
4.86k stars 1.5k forks source link

一个反射型的xss漏洞 #569

Closed thiscodecc closed 3 years ago

thiscodecc commented 4 years ago

搜索处没有对html标签进行过滤,在火狐浏览器输入url: http://127.0.0.1:9000/search/asd%3Cimg%20src=%22x%22%20onerror=%22alert('xss')%22%3E

xss
zealzhangz commented 4 years ago

试了一下Chrome没有这个问题

thiscodecc commented 4 years ago

试了一下Chrome没有这个问题

这个地方xss漏洞是存在,是被chrome 浏览器自身过滤了,在Firefox浏览器可以看到. 刚刚提交了一个在chrome下也有的xss漏洞. #570

zoujiayu commented 3 years ago

该问题在Chrome可以被复现,解决方法: com.tale.controller.IndexController 76行后添加

keyword = (TaleUtils.cleanXSS(keyword));