You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The source code already gave us a hint: /* Prototype Pollution fix */. So I thought the goal is to leverage prototype pollution and trigger XSS via jquery or tooltip.
After trying for few payloads, prototype pollution can be triggered via a[0]=2&a[__proto__][__proto__][abc]=1
But from the source of the web page we know that only $('[data-toggle="tooltip"]').tooltip() has been called after content loaded, so I think it's the key and we need to use it. I tried for an hour to see if I can pollute the template or title options for tooltip but it doesn't work.
After trace the source code of bootstrap tooltip, when tooltip show, getTipElement will be triggered:
But how to show the tooltip? We can show the tooltip if it gets focused, and luckily there is an id for the tooltip element: <span class="d-inline-block" tabindex="0" data-toggle="tooltip" title="Not implemented yet" id="depositButton">
So combined with all the vulnerabilities above, the steps are:
Use lang to import deparam.js
prototype pollution to use jQuery gadget
Use #depositButton to trigger tooltip and do XSS
We can create a simple html page and use iframe to load the website. After it's loaded we update the src to #depositButton to let tooltip get focus and trigger XSS.
Online Wallet (Part 2)
Description
Steal document.cookie
Writeup
There is a very suspicious part for setting lang via query string:
After changing this value, I found that the
lang
is reflected in response.https://wallet.volgactf-task.ru/wallet?lang=abc123
But
<>"'
is escaped so we can't do XSS here. Let's see what's inside s3 bucket: https://volgactf-wallet.s3-us-west-1.amazonaws.comThere is a new file called
deparam.js
which never use in the web page so I guess we need to import this to do something.content:
The source code already gave us a hint:
/* Prototype Pollution fix */
. So I thought the goal is to leverage prototype pollution and trigger XSS via jquery or tooltip.After trying for few payloads, prototype pollution can be triggered via
a[0]=2&a[__proto__][__proto__][abc]=1
POC:
The next step is to see if there is any gadget we can use: https://github.com/BlackFan/client-side-prototype-pollution/blob/master/gadgets/jquery.md
But from the source of the web page we know that only
$('[data-toggle="tooltip"]').tooltip()
has been called after content loaded, so I think it's the key and we need to use it. I tried for an hour to see if I can pollute thetemplate
ortitle
options for tooltip but it doesn't work.After trace the source code of bootstrap tooltip, when tooltip show,
getTipElement
will be triggered:https://github.com/twbs/bootstrap/blob/8fa0d3010112dca5dd6dd501173415856001ba8b/js/src/tooltip.js#L422
template is html so we can use this jQuery gadget now:
But how to show the tooltip? We can show the tooltip if it gets focused, and luckily there is an id for the tooltip element:
<span class="d-inline-block" tabindex="0" data-toggle="tooltip" title="Not implemented yet" id="depositButton">
So combined with all the vulnerabilities above, the steps are:
lang
to importdeparam.js
#depositButton
to trigger tooltip and do XSSWe can create a simple html page and use iframe to load the website. After it's loaded we update the src to
#depositButton
to let tooltip get focus and trigger XSS.The text was updated successfully, but these errors were encountered: