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.

Chapter 3 n Web Application Technologies 61<br />

In <strong>the</strong> earliest days of <strong>web</strong> <strong>application</strong> security, CSS was largely overlooked<br />

and was considered to have no security implications. Today, CSS is increasingly<br />

relevant both as a source of security vulnerabilities in its own right and as a<br />

means of delivering effective exploits for o<strong>the</strong>r categories of vulnerabilities (see<br />

Chapters 12 and 13 for more information).<br />

JavaScript<br />

Hyperlinks and forms can be used to create a rich user interface that can easily<br />

ga<strong>the</strong>r most kinds of input that <strong>web</strong> <strong>application</strong>s require. However, most <strong>application</strong>s<br />

employ a more distributed model, in which <strong>the</strong> client side is used not<br />

simply to submit user data and actions but also to perform actual processing<br />

of data. This is done for two primary reasons:<br />

n It can improve <strong>the</strong> <strong>application</strong>’s performance, because certain tasks can<br />

be carried out entirely on <strong>the</strong> client component, without needing to make<br />

a round trip of request and response to <strong>the</strong> server.<br />

n It can enhance usability, because parts of <strong>the</strong> user interface can be dynamically<br />

updated in response to user actions, without needing to load an<br />

entirely new HTML page delivered by <strong>the</strong> server.<br />

JavaScript is a relatively simple but powerful programming language that<br />

can be easily used to extend <strong>web</strong> interfaces in ways that are not possible using<br />

HTML alone. It is commonly used to perform <strong>the</strong> following tasks:<br />

n Validating user-entered data before it is submitted to <strong>the</strong> server to avoid<br />

unnecessary requests if <strong>the</strong> data contains errors<br />

n Dynamically modifying <strong>the</strong> user interface in response to user actions — for<br />

example, to implement drop-down menus and o<strong>the</strong>r controls familiar<br />

from non-<strong>web</strong> interfaces<br />

n Querying and updating <strong>the</strong> document object model (DOM) within <strong>the</strong><br />

browser to control <strong>the</strong> browser’s behavior (<strong>the</strong> browser DOM is described<br />

in a moment)<br />

VBScript<br />

VBScript is an alternative to JavaScript that is supported only in <strong>the</strong> Internet<br />

Explorer browser. It is modeled on Visual Basic and allows interaction with<br />

<strong>the</strong> browser DOM. But in general it is somewhat less powerful and developed<br />

than JavaScript.<br />

Due to its browser-specific nature, VBScript is scarcely used in today’s <strong>web</strong><br />

<strong>application</strong>s. Its main interest from a security perspective is as a means of<br />

delivering exploits for vulnerabilities such as cross-site scripting in occasional<br />

situations where an exploit using JavaScript is not feasible (see Chapter 12).

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

Saved successfully!

Ooh no, something went wrong!