假设我有一个Web应用程序接受一个名为“content”的参数。此参数中存在的任何内容都将作为HTML响应的一部分输出。
JSP代码示例:
<%= request.getParameter("content") %>
我知道这很愚蠢,应该进行消毒等等,但我的问题是攻击者是否真的可以利用这一点?据我所知,你只会更改发送给自己的内容,所以攻击者唯一能伤害的是他自己?对的?
your.vulnerable.site.com/page.jsp?content=<img src="lol" onerror="javascript('code, that posts the users cookie to the attackers site')" />
What is the general concept behind XSS?