attacking authentication

20
ATTACKING AUTHENTICATION The Web Application Hacker’s Handbook, Ch. 6 Presenter: Jie Huang 10/31/2012

Upload: floria

Post on 24-Feb-2016

98 views

Category:

Documents


4 download

DESCRIPTION

ATTACKING AUTHENTICATION. The Web Application Hacker’s Handbook, Ch. 6 Presenter: Jie Huang 10/31/2012. Authentication is Everywhere . Probably the simplest security mechanisms within web applications Front line of defense against malicious attack - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ATTACKING AUTHENTICATION

ATTACKING AUTHENTICATIONThe Web Application Hacker’s Handbook, Ch. 6

Presenter: Jie Huang10/31/2012

Page 2: ATTACKING AUTHENTICATION

Authentication is Everywhere • Probably the simplest security mechanisms within web applications

• Front line of defense against malicious attack• Widely used technology: HTML forms-based authentication

• You might use it every day! (username + password)

Page 3: ATTACKING AUTHENTICATION

Other Authentication Technologies• Multi-factor mechanisms• Client SSL certificates and/or smartcards• HTTP basic and digest authentication• Windows-integrated authentication • Authentication services

Page 4: ATTACKING AUTHENTICATION

It Could Be the Achilles’ Heel As Well• You think your password is strong enough?• You think using https to transmit your login information is secure enough?

• Probably NOT!• Authentication might be the weakest link within the whole application

Page 5: ATTACKING AUTHENTICATION

Two Major Flaws in Authentication• Design flaws

• Authentication functionality is subject to more design weakness than any other security mechanism employed in web applications

• Implementation flaws• Even a well-designed authentication mechanism

may be highly insecure due to mistakes made in its implementation

Page 6: ATTACKING AUTHENTICATION

Design Flaws• Something you did not think it can be a vulnerability• Verbose Failure Messages - gives attackers lots of

information to collect• Vulnerable Transmission of Credentials • Password Change Functionality• Forgotten Password Functionality• Incomplete Validation of Credentials

Page 7: ATTACKING AUTHENTICATION

Verbose Failure Messages• Error messages can have much information for attackers to harvest

Page 8: ATTACKING AUTHENTICATION

Verbose Failure Messages • This vulnerability can be in more subtle ways

• Error messages might be the same for both valid and invalid usernames, but there might be some differences hidden in HTML source (comments or layout differences, etc.)

Page 9: ATTACKING AUTHENTICATION

Verbose Failure Messages • What if the sources are also the same?

• Potential vulnerabilities are still there - difference in responding time for valid and invalid credentials

Page 10: ATTACKING AUTHENTICATION

Vulnerable Transmission of Credentials

• We all know HTTPS should be used. But from which stage should it be used?• When the login information needs to be submitted?• Or when the login page is loaded?

• You can’t trust the login page if it is loaded as HTTP since you can’t tell its authenticity

Page 11: ATTACKING AUTHENTICATION

Password Change Functionality• This function is needed for users to periodically change the password

• Still, it is vulnerable by design • It might provide a verbose error message indicating

whether the requested username is valid• It might allow unrestricted guesses of the “existing

password” field

Page 12: ATTACKING AUTHENTICATION

Forgotten Password Functionality• Similar to change password function, this function is needed

• However, it might be the weakest link at which to attack the overall authentication logic!

Page 13: ATTACKING AUTHENTICATION

Forgotten Password Functionality• Users are inclined to set extremely insecure challenges with the false assumption that only they will be presented with them• Example: “Do I own a boat?”• Now the attacker has 50% chance of guessing it

correctly (only two possible answers: yes or no)• Some applications disclose the existing, forgotten password to the user after successful completion of challengs

Page 14: ATTACKING AUTHENTICATION

Forgotten Password Functionality• Some applications immediately drop the user into an authenticated session after successful completion of challenges

• Some apps send a unique recovery URL to the email address specified by the user at the time the challenge is completed

• Some apps allow users(attackers) to reset password directly after successful completion of challenge, without sending a notification to the real user

Page 15: ATTACKING AUTHENTICATION

Incomplete Validation of Credentials• Believe it or not, some applications truncate passwords and so only validate the first characters

• Some apps strip out unusual characters• Some apps perform a case-insensitive check of passwords

• Each of the above reduces by an order of magnitude the number of available passwords in the pool of possible passwords!

Page 16: ATTACKING AUTHENTICATION

Implementation Flaws• Even if the design is perfectly secure, hackers still get some chances• Defects in multistage login mechanisms

Page 17: ATTACKING AUTHENTICATION

Defects in Multistage Login Mechanisms

• Multistage mechanisms often have logic flaws• They often make unsafe assumptions

• It may assume that a user who accessed stage three must have cleared stages one and two

• It may trust some of the data being processed at stage two because it was validated at stage one

Page 18: ATTACKING AUTHENTICATION

Defects in Multistage Login Mechanisms

• Some apps employ a randomly varying question at one of the stages of the login process

• This functionality can be broken in some cases• The app may store the details of the challenge

question within a hidden HTML form or cookie, rather than on the server. Attackers can capture user’s input and reuse it later

• The app may ask the user a fresh question when the user tries to login again after a failed attempt

Page 19: ATTACKING AUTHENTICATION

Securing Authentication• Use strong credentials• Handle credentials secretively• Validate credentials properly• Prevent information leakage• Prevent brute-force attack• Prevent misuse of password change function• Prevent misuse of account recovery function• Log, monitor, and notify

Page 20: ATTACKING AUTHENTICATION

THANK YOU!