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 8 n Attacking Access Controls 259<br />

n Horizontal privilege escalation occurs when a user can view or modify<br />

resources to which he is not entitled. For example, if you can use a <strong>web</strong><br />

mail <strong>application</strong> to read o<strong>the</strong>r people’s e-mail, or if a payment clerk can<br />

process invoices for an organizational unit o<strong>the</strong>r than his own, access<br />

controls are broken.<br />

n Business logic exploitation occurs when a user can exploit a flaw in <strong>the</strong><br />

<strong>application</strong>’s state machine to gain access to a key resource. For example,<br />

a user may be able to bypass <strong>the</strong> payment step in a shopping checkout<br />

sequence.<br />

It is common to find cases where vulnerability in <strong>the</strong> <strong>application</strong>’s horizontal<br />

separation of privileges can lead immediately to a vertical escalation attack. For<br />

example, if a user finds a way to set a different user’s password, <strong>the</strong> user can<br />

attack an administrative account and take control of <strong>the</strong> <strong>application</strong>.<br />

In <strong>the</strong> cases described so far, broken access controls enable users who have<br />

au<strong>the</strong>nticated <strong>the</strong>mselves to <strong>the</strong> <strong>application</strong> in a particular user context to perform<br />

actions or access data for which that context does not authorize <strong>the</strong>m.<br />

However, in <strong>the</strong> most serious cases of broken access control, it may be possible<br />

for completely unauthorized users to gain access to functionality or data that<br />

is intended to be accessed only by privileged au<strong>the</strong>nticated users.<br />

Completely Unprotected Functionality<br />

In many cases of broken access controls, sensitive functionality and resources<br />

can be accessed by anyone who knows <strong>the</strong> relevant URL. For example, with<br />

many <strong>application</strong>s, anyone who visits a specific URL can make full use of its<br />

administrative functions:<br />

https://wahh-app.com/admin/<br />

In this situation, <strong>the</strong> <strong>application</strong> typically enforces access control only to <strong>the</strong><br />

following extent: users who have logged in as administrators see a link to this<br />

URL on <strong>the</strong>ir user interface, and o<strong>the</strong>r users do not. This cosmetic difference<br />

is <strong>the</strong> only mechanism in place to “protect” <strong>the</strong> sensitive functionality from<br />

unauthorized use.<br />

Sometimes, <strong>the</strong> URL that grants access to powerful functions may be less<br />

easy to guess, and may even be quite cryptic:<br />

https://wahh-app.com/menus/secure/ff457/DoAdminMenu2.jsp<br />

Here, access to administrative functions is protected by <strong>the</strong> assumption that<br />

an attacker will not know or discover this URL. The <strong>application</strong> is harder for<br />

an outsider to compromise, because he is less likely to guess <strong>the</strong> URL by which<br />

he can do so.

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

Saved successfully!

Ooh no, something went wrong!