+1 (512) 588 6950

DOM XSS Using Web Messages (Practioner) — Portswigger Lab 1 | Solution and Approach

Home/DOM XSS Using Web Messages (Pr...
DOM XSS Using Web Messages (Practioner) — Portswigger Lab 1 | Solution and Approach

1. What is the DOM?

The Document Object Model (DOM) is a web browser’s hierarchical representation of the elements on the page.

Websites can use JavaScript to manipulate the nodes and objects of the DOM, as well as their properties. DOM manipulation in itself is not a problem. In fact, it is an integral part of how modern websites work. However, JavaScript that handles data insecurely can enable various attacks.

DOM-based vulnerabilities arise when a website contains JavaScript that takes an attacker-controllable value, known as a source, and passes it into a dangerous function, known as a sink.

2. What is DOM-based cross-site scripting (XSS)?

DOM-based XSS vulnerabilities usually arise when JavaScript takes data from an attacker-controllable source, such as the URL, and passes it to a sink that supports dynamic code execution, such as eval() or innerHTML

3. How to Exploit DOM-Based XSS

The most common source for DOM XSS is the URL, which is typically accessed with the window.location object.

An attacker can construct a link to send a victim to a vulnerable page with a payload in the query string and fragment portions of the URL.In some cases targeting a 404 page or a website running PHP, the payload can also be placed in the path.

We Have Found a Script that Contains an addEventListener() call that listens for the Message

2. Store the below Payload in the Exploit Server’s Body and click Deliver it to the Victim. Make sure to add your LAB ID in the below Payload

Leave a Reply