https://github.com/sofish/imageXSS.js
防止外部链接通过图片进行 XSS 攻击
https://github.com/sofish/imageXSS.js
Last synced: about 1 year ago
JSON representation
防止外部链接通过图片进行 XSS 攻击
- Host: GitHub
- URL: https://github.com/sofish/imageXSS.js
- Owner: sofish
- Created: 2012-12-06T02:59:59.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-12-06T04:52:48.000Z (over 13 years ago)
- Last Synced: 2025-04-23T16:06:31.590Z (over 1 year ago)
- Language: JavaScript
- Size: 104 KB
- Stars: 47
- Watchers: 6
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## imageXSS.js
一个简洁的方式,提供防止外部链接通过图片进行 XSS 攻击的方案。使用方法:
1. 引用 script:
```html
```
2. 添加 html 属性:
```html
```
## Testcase:
在浏览器打开 `/testcase/` 目录
## 原理:
images 如果 `Content-Type` 不对的话,并不会触发 load 事件。
详细说明:[通过 img URL 实施 XSS 的解决方案](http://sofish.de/2138)