Session Management (SMK)

SESSION MANAGEMENT
K

Peter pode contornar os controles de gerenciamento de sessão porque eles foram construídos internamente e/ou são fracos, ao invés de usar um framework padrão ou módulo aprovado e testado

How to play?

Relying on self-built, inadequately tested session management instead of a standard, vetted framework lets attackers bypass controls and hijack user sessions. See Session Management (SMQ) for application-wide coverage.

Scenario: Peter’s Exploitation of Self-Built Weak Session Controls

Imagine a scenario where Peter exploits vulnerabilities in an application that relies on self-built, potentially weak session management controls instead of using a standard, well-tested framework or module. This situation arises due to:

  1. Self-Built Session Management Systems: The application uses custom-built session management mechanisms that may not adhere to industry best practices.
  2. Lack of Standard Framework Implementation: Instead of leveraging proven and tested frameworks or modules, the system relies on in-house solutions that might lack robustness.

Example

Peter discovers that a bespoke website uses a custom session management system developed in-house. This system, while functional, does not incorporate the latest security practices and is vulnerable to session hijacking and fixation attacks. Capitalizing on these weaknesses, Peter manipulates session tokens to gain unauthorized access to user accounts, bypassing the inadequate session control mechanisms.

Threat Modeling

STRIDE

This scenario maps primarily to STRIDE: Spoofing.

Spoofing is about impersonating a legitimate user or entity. Peter exploits weaknesses in a self-built or weak session management system, allowing him to bypass session controls and assume the identity of legitimate users. The attack is centered on unauthorized impersonation via inadequate session enforcement, making Spoofing the correct primary category.

What can go wrong?

Custom-built session management systems that lack the rigor of standard frameworks can lead to serious security breaches, including unauthorized access and data theft.

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?

Centralized session management routines are a good programming practice, but like other routines, developers need to understand how they work, how to use them and any limitations. These should preferably be the framework's in-built session management support. If third party session management libraries are used, it is important to test each routine before its implementation.

  1. Where possible, replace self-built session management systems with standard, well-tested frameworks or modules known for robust security.
  2. If a custom solution is necessary, ensure it is developed according to industry best practices and undergoes rigorous security testing.
  3. Regularly review and update the session management system to incorporate the latest security advancements and patches.

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

STRIDE: Spoofing

OWASP ASVS: 4.4.3,7.2.1,7.2.2,10.1.1,10.1.2,10.2.1,10.2.2,10.2.3,10.3.1,10.3.2,10.3.3,10.3.4,10.3.5,10.4.1,10.4.2,10.4.3,10.4.4,10.4.5,10.4.6,10.4.7,10.4.8,10.4.9,10.4.10,10.4.11,10.4.12,10.4.13,10.4.14,10.4.15,10.4.16,10.5.1,10.5.2,10.5.3,10.5.4,10.5.5,10.6.1,10.6.2,10.7.1,10.7.2,10.7.3,13.2.1,16.3.3,16.3.4

CAPEC: 21,633

OWASP DevGuide: SM1,SM2,SM3

SAFECode: 14,28

CAPEC™ Map

ASVS (5.0) Cheat Sheet Series Index

Attacks

Data tampering

Password Guessing/Brute Force Attacks

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.