Session Management (SM8)

SESSION MANAGEMENT
8

Мэтт может злоупотреблять долгими сеансами, потому что приложение не требует периодической повторной аутентификации, чтобы проверить, изменились ли привилегии

How to play?

A user's privileges may change during a session. If this information is also stored in session data, it will not reflect the changes. Consider forcing re-authentication. See Authentication Authentication 9 (AT9) for re-authentication requirements.

Scenario: Matt’s Abuse of Long-Lasting Sessions

Visualize a scenario where Matt exploits the lack of periodic re-authentication in an application. This issue arises because:

  1. Prolonged Session Duration: The application allows sessions to remain active for extended periods without re-verifying the user's identity or privileges.
  2. No Checks for Privilege Changes: The system does not reassess user privileges during long sessions, potentially missing changes in user status or permissions.

Example

Matt gains access to an employee’s account in a corporate system early in the day. Throughout the day, the employee’s access rights are revoked due to a change in their employment status. However, since the system does not require re-authentication or check for privilege changes during active sessions, Matt continues to have access to sensitive information and system functionalities all day, exploiting the unchanged session privileges.

Threat Modeling

STRIDE

This scenario maps primarily to STRIDE: Elevation of Privilege.

Elevation of Privilege (EoP) occurs when an attacker gains access to more privileges than they are supposed to have. In this case, Matt exploits long sessions without periodic re-authentication. Even though the legitimate user’s privileges are reduced during the day, the session retains the previous access rights. The attack is not about impersonating someone new (Spoofing), but about continuing to have unauthorized privileges, which is classic Elevation of Privilege.

What can go wrong?

This vulnerability can lead to unauthorized access and misuse of privileges, especially in cases where user privileges have been altered or revoked.

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?

  1. Implement a system for periodic re-authentication, especially for sessions that last beyond a certain time threshold.
  2. Regularly check and update user privileges within active sessions to ensure they reflect current permissions.
  3. Consider introducing shorter session timeouts for highly sensitive applications, requiring users to re-authenticate more frequently.

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 (v4.0): 3.3.2,3.6.1

OWASP DevGuide: SM19,SM21,SM23,SM24

STRIDE: Elevation of Privilege

OWASP SCP: 96

OWASP AppSensor: -

CAPEC™: 464,593

SAFECode™: 28

ASVS (4.0.3) Cheat Sheet Series Index

Privilege escalation

Session Fixation

Session Hijacking (Man-in-the-Middle)

Session Timeout Issues

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.