29.4 Lab: DOM XSS via an alternative prototype pollution vector
This lab is vulnerable to DOM XSS via client-side prototype pollution. To solve the lab: Find a source that you can use to add arbitrary properties to the global Object.prototype. Identify a gadget property that allows you to execute arbitrary JavaScript. Combine these to call alert() | Karthikeyan Nagaraj
Description
This lab is vulnerable to DOM XSS via client-side prototype pollution. To solve the lab:
- Find a source that you can use to add arbitrary properties to the global
Object.prototype
. - Identify a gadget property that allows you to execute arbitrary JavaScript.
- Combine these to call
alert()
.
You can solve this lab manually in your browser, or use DOM Invader to help you.
Solution
- Load the lab in Burp’s built-in browser.
- Enable DOM Invader and enable the prototype pollution option.
- Open the browser DevTools panel and go to the DOM Invader tab and reload the page.
- Observe that DOM Invader has identified a prototype pollution vector in the
search
property i.e. the query string. - Click Scan for gadgets. A new tab opens in which DOM Invader begins scanning for gadgets using the selected source.
- When the scan is complete, open the DevTools panel in the same tab as the scan, then go to the DOM Invader tab.
- Observe that DOM Invader has successfully accessed the
eval()
sink via thesequence
gadget. - Click Exploit. Observe that DOM Invader’s auto-generated proof-of-concept doesn’t trigger an
alert()
. - Go back to the previous browser tab and look at the
eval()
sink again in DOM Invader. Notice that following the closing canary string, a numeric1
character has been appended to the payload. - Click Exploit again. In the new tab that loads, append a minus character (
-
) to the URL and reload the page. - Observe that the
alert(1)
is called and the lab is solved.
A YouTube Channel for Cybersecurity Lab’s Poc and Write-ups
Telegram Channel for Free Ethical Hacking Dumps
Thank you for Reading!
Happy Ethical Hacking ~
Author: Karthikeyan Nagaraj ~ Cyberw1ng