HTML5 Security Cheatsheet - A collection of HTML5 related XSS attack vectors
See the codeThis is the home of the H5SC or HTML5 Security Cheatsheet. Here you will find three things:
The H5SC is an archive, kept online and readable on purpose. The 149 vectors were collected and verified between 2010 and 2016, with the last additions in 2022. They document how browsers behaved in that period, and that is the value of the collection: a large share of what sanitizers, filters and browsers do today exists because of what is catalogued here.
What this means in practice:
browsers field of each vector describes the engines of its day. "latest" means "latest
as of when the vector was verified", not "current". Internet Explorer, Presto-era Opera, E4X,
XBL, behavior: and VML entries describe engines that no longer ship, but still turn up in
mail clients, embedded webviews and legacy sanitizer code.For a living, engine-verified list of XSS payloads see PortSwigger's Cross-Site Scripting cheat sheet. For the reasoning behind attack classes rather than individual payloads, see the DOMPurify wiki page Attack Classes & Bypass History. For markup that causes requests rather than script execution, see HTTPLeaks.
The collection of XSS vectors can be found here: https://html5sec.org/
The data lives in this repository as plain JavaScript modules and can be used without the site:
items.js - the 149 vectors with name, payload, description, fix advice, browser matrix,
tags and reporter, in seven languages (en, ja, ru, cs, de, tr, zh; not every entry has every
translation).payloads.js - the %js_alert%-style placeholders the vectors are written against, so the
same vector can be rendered with an alert, a confirm, or your own probe.categories.js - the category labels.vectors.txt - all vectors in one text file for easy copy and paste.lib/index.js exposes all three as a CommonJS module.
We published a list of files useful for XSS testing in various situations. They are served from
https://html5sec.org/ and stored in the /attachments sub-folder of this repository:
Pull requests welcome.
The H5SC has a few "hidden" features on https://html5sec.org/:
/rss/+/ gives a unix timestamp 300 seconds in future (for ease use)/rss/+123/ gives a unix timestamp 123 seconds in future/rss/1234/ will serve a minimal rss feed until unix time is 1234.vectors()innerHTML? Open https://html5sec.org/?innerHTML307: https://html5sec.org/r/data/307301: https://html5sec.org/r/javascript/301301, 302, 303, 307, 308, 999data, javascript, jar, script (redirecting to https://html5sec.org/%3cscript>alert(1)%3c/script>/)If you have a vector that belongs here, open a pull request against items.js. Copy the shape of an
existing entry, use the next free id, fill in at least the en strings, list the engines and
versions you verified it in, and credit the reporter. Translations of existing entries are welcome
too; the de strings in particular are mostly empty.
Mozilla Public License 2.0, see LICENSE.
1,321 followers · starred Mar 2014
479 followers · starred Apr 2014
493 followers · starred Apr 2014
87 followers · starred Mar 2014
HTML5 Security Cheatsheet - A collection of HTML5 related XSS attack vectors
See the codeThis is the home of the H5SC or HTML5 Security Cheatsheet. Here you will find three things:
The H5SC is an archive, kept online and readable on purpose. The 149 vectors were collected and verified between 2010 and 2016, with the last additions in 2022. They document how browsers behaved in that period, and that is the value of the collection: a large share of what sanitizers, filters and browsers do today exists because of what is catalogued here.
What this means in practice:
browsers field of each vector describes the engines of its day. "latest" means "latest
as of when the vector was verified", not "current". Internet Explorer, Presto-era Opera, E4X,
XBL, behavior: and VML entries describe engines that no longer ship, but still turn up in
mail clients, embedded webviews and legacy sanitizer code.For a living, engine-verified list of XSS payloads see PortSwigger's Cross-Site Scripting cheat sheet. For the reasoning behind attack classes rather than individual payloads, see the DOMPurify wiki page Attack Classes & Bypass History. For markup that causes requests rather than script execution, see HTTPLeaks.
The collection of XSS vectors can be found here: https://html5sec.org/
The data lives in this repository as plain JavaScript modules and can be used without the site:
items.js - the 149 vectors with name, payload, description, fix advice, browser matrix,
tags and reporter, in seven languages (en, ja, ru, cs, de, tr, zh; not every entry has every
translation).payloads.js - the %js_alert%-style placeholders the vectors are written against, so the
same vector can be rendered with an alert, a confirm, or your own probe.categories.js - the category labels.vectors.txt - all vectors in one text file for easy copy and paste.lib/index.js exposes all three as a CommonJS module.
We published a list of files useful for XSS testing in various situations. They are served from
https://html5sec.org/ and stored in the /attachments sub-folder of this repository:
Pull requests welcome.
The H5SC has a few "hidden" features on https://html5sec.org/:
/rss/+/ gives a unix timestamp 300 seconds in future (for ease use)/rss/+123/ gives a unix timestamp 123 seconds in future/rss/1234/ will serve a minimal rss feed until unix time is 1234.vectors()innerHTML? Open https://html5sec.org/?innerHTML307: https://html5sec.org/r/data/307301: https://html5sec.org/r/javascript/301301, 302, 303, 307, 308, 999data, javascript, jar, script (redirecting to https://html5sec.org/%3cscript>alert(1)%3c/script>/)If you have a vector that belongs here, open a pull request against items.js. Copy the shape of an
existing entry, use the next free id, fill in at least the en strings, list the engines and
versions you verified it in, and credit the reporter. Translations of existing entries are welcome
too; the de strings in particular are mostly empty.
Mozilla Public License 2.0, see LICENSE.
1,321 followers · starred Mar 2014
479 followers · starred Apr 2014
493 followers · starred Apr 2014
87 followers · starred Mar 2014