19.09.2017 Views

the-web-application-hackers-handbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

458 Chapter 12 n Attacking Users: Cross-Site Scripting<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

HTML5 provides a wealth of new vectors using event handlers. These include<br />

<strong>the</strong> use of <strong>the</strong> autofocus attribute to automatically trigger events that previously<br />

required user interaction:<br />

<br />

<br />

...<br />

It allows event handlers in closing tags:<br />

<br />

Finally, HTML5 introduces new tags with event handlers:<br />

<br />

<br />

Script Pseudo-Protocols<br />

Script pseudo-protocols can be used in various locations to execute inline script<br />

within an attribute that expects a URL. Here are some examples:<br />

<br />

<br />

<br />

Although <strong>the</strong> javascript pseudo-protocol is most commonly given as an<br />

example of this technique, you can also use <strong>the</strong> vbs protocol on Internet Explorer<br />

browsers, as described later in this chapter.<br />

As with event handlers, HTML5 provides some new ways of using script<br />

pseudo-protocols in XSS attacks:<br />

<br />

<br />

The new event-source tag is of particular interest when targeting input filters.<br />

Unlike any pre-HTML5 tags, its name includes a hyphen, so using this tag may<br />

bypass legacy regex-based filters that assume tag names can contain only letters.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!