I am testing a scenario with Burp proxy.
I am located on a website
https://website.com/web
There's an option there to delete an item, when you click it , a certain POST request is sent (
XMLHttpRequest
, no page refresh is happening) where I can insert a<script>
tag:POST /web/deleteItem HTTP/1.1 Host: website.com returnParameter=<script>alert('xss')</script>
deleteItem
method returns the following:HTTP/1.1 200 OK Date: Tue, 31 Jan 2017 22:18:54 GMT X-XSS-Protection: 1; mode=block Content-Type: application/json;charset=UTF-8 ... {"status":"SUCCESS","result":"<script>alert('xss')</script>"}
On a website from step #1 there are JavaScript functions that parse the JSON and show its result value on the screen
alert
is being shown onhttps://website.com/web
, so reflected XSS was successfully executed.
But this scenario is not realistic as I need to draw a user to the website and execute the XSS somehow.
I have tried this by making a simple HTML POST form and submitting the parameters to https://website.com/web/deleteItem
. Lets say that I would use phishing and user would submit the form.
The action was indeed executed, but I only received a JSON response. There was no page from step #1, so nothing was actually shown as XSS, because the user was not located on https://website.com/web
where alert('XSS')
should be executed. I am not sure is it possible to send the user to page #1 and send it this JSON with XSS somehow.
Could there be a way to execute this scenario in realistic conditions?