← back to room
XSS

XSS in an Attribute

Scenario

The marketing team moved the greeting into a highlighted quote box with a custom tooltip attribute. Your name now sits inside double quotes in an HTML attribute value. Break out of that attribute so the browser still runs your payload.

Your approach

  1. Open the attribute-context lab and note the input field feeding the tooltip.
  2. Inspect the rendered HTML to see quotes wrapping your value.
  3. Craft a payload that closes the attribute and adds an event handler.
  4. Verify JavaScript fires and the lab reveals its flag.
  5. Submit the flag from the success message.
The value is reflected inside value="...". Break out of the attribute and get JS to run — the flag will appear.

Search