This vulnerability occurs when a web application fails to properly sanitize or escape script code within the attributes of HTML IMG tags, such as the 'src' attribute.
Attackers can inject malicious scripts (XSS) into seemingly harmless image tag attributes. When a victim's browser loads the compromised page, it processes the tainted attribute and executes the injected code, often without any visible indication to the user. This type of attack exploits the trust a browser has in content served by the application. To prevent it, developers must rigorously validate and encode all user-supplied data before it is inserted into HTML attributes, treating attribute values as untrusted by default.
Impact: Read Application DataExecute Unauthorized Code or Commands
Strategy: Output Encoding
Strategy: Attack Surface Reduction
Effectiveness: Defense in Depth