Security pattern / case archive

HTML Attribute Injection

Untrusted input escapes an existing HTML attribute value and creates attacker-controlled attributes on the rendered element.

Common discovery signals
  • A quotation mark terminates a reflected quoted attribute value.
  • A harmless data attribute appears in the parsed DOM.
Safe validation approach

Use a non-executing data-* canary to confirm the DOM structure before a small browser-side test.

Related classifications

Related entries

Archive connections

Connected case files

01 record
CASE-001WEBVERSE
Connected evidence

Echoed

Reflected XSS

The q parameter was reflected into two HTML contexts. A raw double quote broke out of the search input value attribute, enabling attacker-controlled autofocus and onfocus attributes and browser-side JavaScript execution.