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.

176 Chapter 6 n Attacking Au<strong>the</strong>ntication<br />

“Remember Me” Functionality<br />

Applications often implement “remember me” functions as a convenience to<br />

users. This way, users don’t need to reenter <strong>the</strong>ir username and password each<br />

time <strong>the</strong>y use <strong>the</strong> <strong>application</strong> from a specific computer. These functions are<br />

often insecure by design and leave <strong>the</strong> user exposed to attack both locally and<br />

by users on o<strong>the</strong>r computers:<br />

n Some “remember me” functions are implemented using a simple persistent<br />

cookie, such as RememberUser=daf (see Figure 6-6). When this<br />

cookie is submitted to <strong>the</strong> initial <strong>application</strong> page, <strong>the</strong> <strong>application</strong> trusts<br />

<strong>the</strong> cookie to au<strong>the</strong>nticate <strong>the</strong> user, and it creates an <strong>application</strong> session<br />

for that person, bypassing <strong>the</strong> login. An attacker can use a list of common<br />

or enumerated usernames to gain full access to <strong>the</strong> <strong>application</strong> without<br />

any au<strong>the</strong>ntication.<br />

Figure 6-6: A vulnerable “remember me” function, which automatically logs in a<br />

user based solely on a username stored in a cookie

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

Saved successfully!

Ooh no, something went wrong!