Giter VIP home page Giter VIP logo

auth's Introduction

03 July 2004

TODO 
 * Session fixation attack (BUG #2021)
 * Fix multiple open windows and challenge responce cookies (use a list of cookies which are allowed)

Since Auth 1.3 new security functionality has been added.
The main purpose for these advanced security checks is to avoid man-in-the-middle attacks and
session hijacking.


Session hijacking example 
  - Login to an Auth protected page. Write down the session id (should be something like PHPSESSID=36916b0aa1180386010f304b6160e3e8)
  - Open a different browser (FireFox <> IE), or a browser on a different computer
  - Type down the address of the secure page and add ?PHPSESSID=36916b0aa1180386010f304b6160e3e8 where
    PHPSESSID is the php session name and 36916b0aa1180386010f304b6160e3e8 is the valid session id which you wrote down earlier
  - You should be logged in with the same creditentials
  


To enable the advanced scurity checks you have to call
$auth->setAdvancedSecurity();

If this has been enabled the following security checks will be performed

  - Login screen will use md5 when submitting the password if java script is enabled in the browser
  - If user ip address has been changed betwin requests the user will be logged out
  - If user User-Agent string has been changed the user will be logged out
  - If user does not provide a valid auth challenge cookied he will be logged out (read below for explanation)
  
Limitations
 * Challenge responce cookies would not allow a user to open multiple windows of the same page (Open in new window/tab). If 
 the user accesses the protected area from two browser windows he will be logged out. It can also create a problem if you
 create dynamic images with php and that code passes through the auth layer. One way to avoid it is to disable advanced security for 
 those pages only selectively.
 * Password saving does not work with login screens which use challenge responce (md5 hashing) of password
 * Challenge responce on login only works with DB container and plain or md5 hashing

 


Challenge Responce cookies

 
 The challenge responce cookies provide a way to avoid most of the session hijacking problems. Since User-Agent headers
 and IP address can be spoofed, or in the case of IP a proxy can be used an extra security step has been added using a 
 challenge cookie.
 
 After the user is authenthicated by Auth he is presented with a challenge cookie. For his next request to be succesfull 
 he must present that cookie on his next request. If that is successfull he will be presented with a new 
 challenge cookie. This will be reapeated for each request the user makes.
 
 While this method is not fool proof it does limit the possibilities for an attack.
 First the attacker must must obtain the challenge cookie and use it before the user does.
 If the user makes a request after the attacker the session will be logged out and both of them 
 will need to login again.
 
 A problem which this scheme does not address well is users leaving their sessions without preforming a logout
 in this case the attacker is free to abuse the user session (provided he has met all the prerequisites). 
 
 Ideas and sujestions for improvements are more than welcome.
 send to [email protected]
 

auth's People

Contributors

aashley avatar chregu avatar clockwerx avatar cweiske avatar lawngnome avatar m6w6 avatar mj avatar moosh-be avatar quipo avatar schengawegga avatar sebastianbergmann avatar stigsb avatar tobys avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.