{"id":13814606,"url":"https://github.com/sofish/imageXSS.js","last_synced_at":"2025-05-15T03:34:50.180Z","repository":{"id":5813822,"uuid":"7028844","full_name":"sofish/imageXSS.js","owner":"sofish","description":"防止外部链接通过图片进行 XSS 攻击","archived":false,"fork":false,"pushed_at":"2012-12-06T04:52:48.000Z","size":107,"stargazers_count":47,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-23T16:06:31.590Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sofish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-06T02:59:59.000Z","updated_at":"2024-06-19T13:51:30.000Z","dependencies_parsed_at":"2022-08-31T16:52:08.333Z","dependency_job_id":null,"html_url":"https://github.com/sofish/imageXSS.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2FimageXSS.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2FimageXSS.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2FimageXSS.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2FimageXSS.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sofish","download_url":"https://codeload.github.com/sofish/imageXSS.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254266522,"owners_count":22042123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:02:21.649Z","updated_at":"2025-05-15T03:34:49.864Z","avatar_url":"https://github.com/sofish.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"## imageXSS.js\n\n一个简洁的方式，提供防止外部链接通过图片进行 XSS 攻击的方案。使用方法：\n\n1. 引用 script:\n\n  ```html\n  \u003cscript src=\"jquery.js\" /\u003e\n  \u003cscript src=\"imagexss.js\" /\u003e\n  ```\n\n2. 添加 html 属性：\n\n  ```html\n  \u003cimg src=\"\" data-xssimg=\"图片的链接\" /\u003e\n  ```\n\n\n## Testcase:\n\n在浏览器打开 `/testcase/` 目录\n\n\n## 原理：\n\nimages 如果 `Content-Type` 不对的话，并不会触发 load 事件。\n\n详细说明：[通过 img URL 实施 XSS 的解决方案](http://sofish.de/2138)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofish%2FimageXSS.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsofish%2FimageXSS.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofish%2FimageXSS.js/lists"}