Session Management (SM7)

SESSION MANAGEMENT
7

Graham peut utiliser la session d'Adam après qu'il ait terminé, car il n'existe pas de fonction de déconnexion, ou il ne peut pas se déconnecter facilement, ou parce que la déconnexion et les autres mécanismes pour changer les paramètres d'authentification ne permettent pas à l'utilisateur de terminer la session ou les sessions

How to play?

Inadequate session termination—due to missing, hard-to-use, or ineffective logout functionality—allows attackers to hijack active user sessions.

Scenario: Graham's Exploitation of Inadequate Session Termination

Imagine a situation where Graham takes advantage of a system’s flawed session termination process. This becomes possible because:

  1. Absence of Log Out Function: The system lacks a clear, accessible log out function.
  2. Ineffective Log Out: Even when users attempt to log out, the session is not properly terminated.
  3. Complex Log Out Process: The log out function is not easily accessible or user-friendly, leading to users inadvertently leaving sessions active.
  4. No Session Logout when Authentication Credentials are Changed: The system does not automatically log out users from all sessions when they change their authentication credentials, such as passwords or MFA methods.

Example

Graham targets a web application where users find it difficult to locate the log out button due to its obscure placement. Adam, a user of the application, believes he has exited the session, but in reality, the session remains active. Graham, seizing this opportunity, accesses the still-active session from Adam's device or a public computer Adam used, gaining unauthorized access to Adam’s account and sensitive information.

Threat Modeling

STRIDE

This scenario maps primarily to STRIDE: Spoofing.

Spoofing is about impersonating a legitimate user. Graham exploits the fact that Adam’s session remains active after he “logs out” or fails to log out, allowing him to assume Adam’s identity without needing credentials. The root issue is unauthorized impersonation via an active session, making Spoofing the correct primary category.

What can go wrong?

This flaw can lead to unauthorized session access and potential data breaches, as attackers exploit sessions that users believe to be safely closed.

For more things that can go wrong, see the Common Attack Patterns related to this card in the table below.

What are we going to do about it?

Users should be able to log out from any pages protected by access control (authentication and authorisation checks). The logout functionality should fully terminate the associated session or connection such that the session identifier is no longer usable.

  1. Ensure the log out function is clearly visible and easily accessible on all interfaces of the application.
  2. Design the log out process to completely terminate the session on the server side, not just on the client device.
  3. Conduct user experience testing to ensure the log out process is intuitive and effective.
  4. Implement automatic session termination when users change their authentication credentials to stop ongoing abuse from already stolen sessions.

For detailed advice on how to mitigate threats related to the card, see the ASVS and OWASP Developer Guide requirements in the table below.

Mappings

OWASP ASVS (v5.0): 7.1.3,7.4.1,7.4.3,7.4.4,7.4.5,7.5.2,7.6.1

OWASP DevGuide: SM5,SM6,SM20

STRIDE: Spoofing

CAPEC™: 31,464,593

SAFECode™: 28

CAPEC Map

CodeTitleASVS
31Accessing/Intercepting/Modifying HTTP Cookies
464Evercookie
593Session Hijacking

ASVS (5.0) Cheat Sheet Series Index

Session Fixation

Session Hijacking (Man-in-the-Middle)

OWASP Cornucopia

OWASP Cornucopia is a mechanism in the form of a card game to assist software development teams identify security requirements in Agile, conventional and formal development processes. It is language, platform and technology-agnostic, and is free to use. OWASP Cornucopia is licensed under the Creative Commons Attribution-ShareAlike 4.0 license, so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar licence to this one.

© 2012-2025 OWASP Foundation. The Open Worldwide Application Security Project (OWASP) is a nonprofit foundation that works to improve the security of software.