Reflected XSS into HTML context with all tags blocked except custom ones


The website in this lab blocks all HTML tags except custom ones.

Reproduction and proof of concept

  1. Go to the exploit server and paste the following code, replacing lab-id with your lab ID:

    location = '';


  1. Click Store and Deliver exploit to victim.

This injection creates a custom tag with the ID x, which contains an onfocus event handler that triggers the alert function. The hash at the end of the URL focuses on this element as soon as the page is loaded, causing the alert payload to be called.