Session fixation

Session fixation is een manier om een sessie te stelen waarbij de aanvaller vooraf weet welk session id het slachtoffer krijgt.

http://en.wikipedia.org/wiki/Session_fixation

Mogelijke oplossing:

Plaats volgende code voor het 'session_start':

ini_set('session.cookie_secure',1);
ini_set('session.cookie_httponly',1);
ini_set('session.use_only_cookies',1);
session_start();
  • session.cookie_secure specifies whether cookies should only be sent over secure connections. Defaults to off.
  • session.cookie_httponly marks the cookie as accessible only through the HTTP protocol. This means that the cookie won't be accessible by scripting languages, such as JavaScript?. This setting can effectively help to reduce identity theft through XSS attacks (although it is not supported by all browsers).
  • session.use_only_cookies specifies whether the module will only use cookies to store the session id on the client side. Enabling this setting prevents attacks involved passing session ids in URLs. This setting was added in PHP 4.3.0. Defaults to 1 (enabled) since PHP 5.3.0.

Session hijacking

Session fixation is een manier om een sessie te stelen waarbij de aanvaller de session id van het slachtoffer probeert te achterhalen en deze overneemt.

http://en.wikipedia.org/wiki/Session_hijacking

Mogelijke oplossing:

  • Cookies over https versturen (man in the middle attack prevention)
  • Regenerate session id's per login
  • CSRF voorkomen