XSS attack with javascript in img src attribute

2020-06-11 04:50发布

Some older browsers are vulnerable to XSS attacks as such

<img src="javascript:alert('yo')" />

Current versions of IE, FF, Chrome are not.

I am curious if any browsers are vulnerable to a similar attack:

<img src="somefile.js" />

or

<iframe src="somefile.js" />

or other similar where somefile.js contains some malicious script.

标签: xss security
3条回答
可以哭但决不认输i
2楼-- · 2020-06-11 05:36

No. Image data is never executed as JavaScript. The if the src is a JavaScript link, the JavaScript is executed, but the fundamental reading of data that comes from a request to the src does not involve JavaScript.

查看更多
小情绪 Triste *
3楼-- · 2020-06-11 05:39

All major browsers are still vulnerable to these attacks. Tons of ways of using img tags are still around.. For example...

<img src='#' onerror=alert(1) />

Look for RSnake's xss cheatsheet, those are just some vectors. By the way, I've heard he's coming up with a new version of his cheatsheet soon.

查看更多
贪生不怕死
4楼-- · 2020-06-11 05:39

here you can find some XSS attacking vector http://ha.ckers.org/xss.html

查看更多
登录 后发表回答