Saturday 2 April 2016

HTML5 Security Cheatsheet

The new home of the H5SC or HTML5 Security Cheatsheet. Here you will find three things:
  • A collection of HTML5 related XSS attack vectors
  • A set of useful files for XSS testing
  • A set of formerly hidden features useful for XSS testing  


The XSS Vectors

The collection of XSS vectors can be found here: https://html5sec.org/

Useful Files

We published a list of files useful for XSS testing in various situations. Currently the following files are available:
Pull requests welcome, we store the files in the /attachments sub-folder.

Hidden Features

The H5SC currently has three "hidden" features

How to use : 

Vectors making use of HTML5 features


XSS via formaction - requiring user interaction (1)#1test

A vector displaying the HTML5 form and formaction capabilities for form hijacking outside the actual form.
<form id="test"></form><button form="test" formaction="javascript:alert(1)">X</button>
Don't allow users to submit markup containing "form" and "formaction" attributes or transform them to bogus attributes. Avoid "id" attributes for forms as well as submit buttons.
    • Firefox 4.0
    • Firefox Latest
    • Opera 10.5
    • Opera Latest
    • Chrome 10.0
    • Chrome Latest
    • Safari 4.0.4
    • Safari Latest
    • Internet Explorer 10
    • Internet Explorer Latest (Inside Form Element)
  • xss
  • html5
  • opera
  • chrome
  • firefox
  • formaction
  • javascript
  • button
.mario

Self-executing focus event via autofocus#7test

This vector uses an input element with autofocus to call its own focus event handler - no user interaction required
<input onfocus=write(1) autofocus>
User submitted markup should not contain "autofocus" attributes.
    • Firefox 4.0
    • Firefox Latest
    • Opera 9.0
    • Opera Latest
    • Safari 4.0
    • Safari Latest
    • Chrome 4.0
    • Chrome Latest
    • Internet Explorer 10.0
    • Internet Explorer Latest
  • xss
  • autofocus
  • chrome
  • opera