An open API service indexing awesome lists of open source software.

https://github.com/sofish/imagexss.js

防止外部链接通过图片进行 XSS 攻击
https://github.com/sofish/imagexss.js

Last synced: over 1 year ago
JSON representation

防止外部链接通过图片进行 XSS 攻击

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)