← 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
- Open the attribute-context lab and note the input field feeding the tooltip.
- Inspect the rendered HTML to see quotes wrapping your value.
- Craft a payload that closes the attribute and adds an event handler.
- Verify JavaScript fires and the lab reveals its flag.
- 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.