19.09.2017 Views

the-web-application-hackers-handbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER<br />

6<br />

Attacking Au<strong>the</strong>ntication<br />

On <strong>the</strong> face of it, au<strong>the</strong>ntication is conceptually among <strong>the</strong> simplest of all <strong>the</strong><br />

security mechanisms employed within <strong>web</strong> <strong>application</strong>s. In <strong>the</strong> typical case, a<br />

user supplies her username and password, and <strong>the</strong> <strong>application</strong> must verify that<br />

<strong>the</strong>se items are correct. If so, it lets <strong>the</strong> user in. If not, it does not.<br />

Au<strong>the</strong>ntication also lies at <strong>the</strong> heart of an <strong>application</strong>’s protection against<br />

malicious attack. It is <strong>the</strong> front line of defense against unauthorized access. If an<br />

attacker can defeat those defenses, he will often gain full control of <strong>the</strong> <strong>application</strong>’s<br />

functionality and unrestricted access to <strong>the</strong> data held within it. Without<br />

robust au<strong>the</strong>ntication to rely on, none of <strong>the</strong> o<strong>the</strong>r core security mechanisms<br />

(such as session management and access control) can be effective.<br />

In fact, despite its apparent simplicity, devising a secure au<strong>the</strong>ntication function<br />

is a subtle business. In real-world <strong>web</strong> <strong>application</strong>s au<strong>the</strong>ntication often is<br />

<strong>the</strong> weakest link, which enables an attacker to gain unauthorized access. The<br />

authors have lost count of <strong>the</strong> number of <strong>application</strong>s we have fundamentally<br />

compromised as a result of various defects in au<strong>the</strong>ntication logic.<br />

This chapter looks in detail at <strong>the</strong> wide variety of design and implementation<br />

flaws that commonly afflict <strong>web</strong> <strong>application</strong>s. These typically arise because<br />

<strong>application</strong> designers and developers fail to ask a simple question: What could<br />

an attacker achieve if he targeted our au<strong>the</strong>ntication mechanism? In <strong>the</strong> majority<br />

of cases, as soon as this question is asked in earnest of a particular <strong>application</strong>,<br />

a number of potential vulnerabilities materialize, any one of which may be<br />

sufficient to break <strong>the</strong> <strong>application</strong>.<br />

159

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

Saved successfully!

Ooh no, something went wrong!