Academy
TermData

Session cookie

The proof of identity a site leaves in the browser after sign-in to recognise the user, standing in for the password.

Flow

  1. 1A session is opened
  2. 2The cookie is stolen
  3. 3The cookie is used
Related families
—
MITRE ATT&CK
T1539 · Steal Web Session Cookie
Sources
4 sources
01

Overview

Once a user has signed in, the site does not ask for the password on every request; it checks the session identifier in the browser. According to OWASP, once a session is established the session ID is temporarily equivalent to the strongest authentication method the application uses; capturing it lets an attacker fully impersonate the user. OWASP

According to MITRE ATT&CK, authentication cookies can stay valid for a long time even when the application is not actively used; an attacker who obtains the cookie can import it into their own browser and act as the user for as long as the session remains active. MITRE ATT&CK

According to Google, because cookie theft happens after sign-in it bypasses two-step verification and other sign-in checks; stolen cookies keep working even after the malware is removed. Google Chromium

02

How it works

  1. 1

    A session is opened

    The user enters their password and, if required, a second-factor code; the site writes a session cookie to the browser. OWASP

  2. 2

    The cookie is stolen

    An infostealer reads the browser’s cookie database and sends it out with the rest of the data. MITRE ATT&CK

  3. 3

    The cookie is used

    The attacker loads the cookie into their own browser; the site takes them for the user. MITRE ATT&CK

03

Real-world examples

Google: device-bound sessions

Google announced Device Bound Session Credentials (DBSC), which binds a session to a key on the device that cannot be exported, to make stolen cookies worthless and remove the payoff from selling them. Google Chromium

04

How to detect it

  • The same session being used within a short time from a different country, network or browser fingerprint. MITRE ATT&CK
05

What to do

  • Shorten session lifetimes; end all sessions when the password is changed or after a suspicious sign-in. OWASP
  • For the user of a device with an infostealer infection, do not stop at changing the password; end open sessions too. Google Chromium
06

MITRE ATT&CK

07

Related terms

08

Sources

  1. 1Steal Web Session Cookie (T1539) · MITRE ATT&CK
  2. 2Web Session Cookie (T1550.004) · MITRE ATT&CK
  3. 3Session Management Cheat Sheet · OWASP
  4. 4Fighting cookie theft using device bound sessions · Google Chromium, 2024-04-02