Squirrelmail Anti-Session-Fixation PluginDownload plugin 1.0IntroductionA session fixation attack is when the attacker is able to 'seed' a particular session id in the user's browser. The attacker can do this in a variety of ways, most of which require that they are able to post custom html on a similar domain to the squirrelmail login page. When the user views this custom html, their browser can be tricked into adopting a predetermined session id picked by the attacker. Here is a trivial example of some fixating html:<meta http-equiv="Set-Cookie" content="SQMSESSID=31d857c52046d2e418ea5f24675e5180;domain=.domain.org;path=/">
LinksTo understand session fixation attacks, a good primer is: www.acros.si/papers/session_fixation.pdf Cross site cookie attacks. These attacks make it possible to do session fixation even from a non-similar domain. www.securiteam.com/securityreviews/5EP0L2KHFG.html Wikipedia Reading:en.wikipedia.org/wiki/Session_fixation en.wikipedia.org/wiki/Cross_Site_Cooking NotesIn order to prevent session fixation, we must make sure we delete all the possible session cookies which might exist and which would take priority over our new one. This turns out to be difficult: php will fall back to the session cookie with the shortest path and shortest domain name. Since an attacker would pick this type of cookie, we are forced into creating our session cookie with an equally global scope. In theory, we should be able to delete all the possible cookies with a more global scope than the one we create. This way, we could use a cookie with a path consistant with the squirrelmail configuration. Unfortunately, squirrelmail has a small bug: on the login page, there is a session cookie set with a root path--irrespective of what the session path should be. Later code sets a path for the session cookie: this is all fine and well, but if a root path session cookie is created first, then these others are not used in practice. this initial bad session is created from: login.php --> include(strings.php) -->
$base_uri = sqm_baseuri()
session_set_cookie_params before starting the session. Changes1.0 Thu Mar 16 2006 Original release
|
