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 />

11<br />

Attacking Application Logic<br />

All <strong>web</strong> <strong>application</strong>s employ logic to deliver <strong>the</strong>ir functionality. Writing code<br />

in a programming language involves at its root nothing more than breaking<br />

a complex process into simple and discrete logical steps. Translating a piece<br />

of functionality that is meaningful to human beings into a sequence of small<br />

operations that can be executed by a computer involves a great deal of skill and<br />

discretion. Doing so in an elegant and secure fashion is harder still. When large<br />

numbers of different designers and programmers work in parallel on <strong>the</strong> same<br />

<strong>application</strong>, <strong>the</strong>re is ample opportunity for mistakes to occur.<br />

In all but <strong>the</strong> simplest of <strong>web</strong> <strong>application</strong>s, a vast amount of logic is performed<br />

at every stage. This logic presents an intricate attack surface that is always<br />

present but often overlooked. Many code reviews and penetration tests focus<br />

exclusively on common “headline” vulnerabilities such as SQL injection and<br />

cross-site scripting, because <strong>the</strong>se have an easily recognizable signature and<br />

well-researched exploitation vector. By contrast, flaws in an <strong>application</strong>’s logic<br />

are harder to characterize: each instance may appear to be a unique one-off<br />

occurrence, and <strong>the</strong>y usually are not identified by any automated vulnerability<br />

scanners. As a result, <strong>the</strong>y generally are not as well appreciated or understood,<br />

and <strong>the</strong>refore <strong>the</strong>y are of great interest to an attacker.<br />

This chapter describes <strong>the</strong> kinds of logic flaws that often exist in <strong>web</strong> <strong>application</strong>s<br />

and <strong>the</strong> practical steps you can take to probe and attack an <strong>application</strong>’s<br />

logic. We will present a series of real-world examples, each of which manifests a<br />

different kind of logical defect. Toge<strong>the</strong>r, <strong>the</strong>y illustrate <strong>the</strong> variety of assumptions<br />

405

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

Saved successfully!

Ooh no, something went wrong!