I've come across an API of a web application I'm testing, which reflects with unescaped, unencoded, user-controlled data for some requests. However, the response includes the header Content-Type: application/json;charset=UTF-8
.
The response body is simply a JSON, like the following:
{"name":"foo","title":"bar"}
I did try to perform a simple XSS (classic <script>alert(1)</script>
), but the script isn't executed.
{"name":"<script>alert(1)</script>","title":"bar"}
I've read through this question, but they do not seem to discuss the impact of the content-type header. OWASP seems to flag the reponse-type as "good" in this article.
My question is if the Content-Type
header in the response has an impact on the exploitability of XSS and possibly other vulnerabilities?