Reputation: 7127
On practically every XSS mitigation guide I've seen, the following pattern is mentioned:
<img src="javascript:evil();">
What legitimate use could this possibly have? Can you use JS code to generate a base64-encoded representation or something?
Upvotes: 3
Views: 1179
Reputation: 490233
It doesn't have many legitimate uses.
The way it works is probably because you can use any protocol there, and some browsers implement the javascript
pseudo protocol, which can be invoked from multiple places.
Upvotes: 1
Reputation: 28753
I don't know about a legitimate use, but some browsers (usually older ones) will execute the JavaScript. See the OWASP XSS Filter Evasion Cheat Sheet.
Upvotes: 1