CYBER LIBRARY
Explore the bootcamp
Security essentialsIntermediate

Session fixation

Session fixation occurs when an attacker can cause a victim to authenticate using a session identifier already known to the attacker.

3 min readUpdated 12 Oct 20263 connections
Markdown

What it means

Session fixation occurs when an attacker can cause a victim to authenticate using a session identifier already known to the attacker. Session identifiers should change at security transitions such as login, with prior identifiers invalidated as appropriate. The surrounding session design must also protect creation, transmission, and termination.

A practical example

A website creates an anonymous session for browsing and replaces its identifier after successful authentication. It does not attach privileged account state to the unchanged pre-login identifier, and it invalidates the obsolete identifier on the server.

What to check

Test identifier rotation after login and privilege changes. Review URL-based identifiers, cookie scope, and whether old identifiers continue accessing authenticated state after a transition.

A common pitfall

Adding strong authentication does not protect a session identifier already shared with an attacker if the server keeps that identifier when granting privileges.

Think it through

Why rotate the session identifier after login?

Answer: It prevents the anonymous identifier known before authentication from becoming a reusable credential for the authenticated account.

Authentication changes the value of a session

A fictional shop gives an anonymous visitor a session to hold a basket. After login, that session will be able to view addresses and previous orders. If the identifier remains unchanged, anyone who already knows it may inherit those new privileges. The security transition changes what the credential can do even though its characters look the same.

The application should deliberately manage that transition. Generate a new authenticated session identifier and handle the previous identifier according to the session framework's supported lifecycle. Preserve only the anonymous state the product actually needs, such as a basket, rather than copying every pre-login property into the authenticated context.

The same reasoning applies when privileges increase after renewed authentication or an administrative role switch. Not every state change requires identical handling, but the design should identify where the assurance level or authority changes. Avoid accepting session identifiers through unnecessary channels such as URLs, which can expose them through history, logs, or copied links.

Observe rotation with test identities

In an authorized training service, compare the session identifier before and after a dummy account signs in. Check that the old identifier cannot retrieve the authenticated account state. Also test failed login: a failed attempt should not accidentally create an authenticated session or preserve partially applied privilege changes.

Concurrency needs thought. A browser may have several requests in flight during login, and the framework may need a controlled way to complete the transition. Use supported session mechanisms rather than inventing an identifier migration scheme. Document the desired lifecycle and verify it at the server, because deleting a browser cookie alone does not establish that an earlier credential has lost its authority.

GO TO THE SOURCE

References & further reading

Original explanations, with primary references for deeper study.

OWASP: Session Management
EXPLORE THIS IDEA’S CONNECTIONS

A small part of a bigger picture.

4 notes · 5 connections
100%
Session fixation · depth 1
Drag to pan · Pinch or use +/− to zoom · Click to preview · Double-click to read
Browse notes as a list (4)
FOLLOW ANOTHER THREADExplore the rest of the library
Start with a concept. Follow its connections.
Detection & responseAbuse Elevation Control MechanismElevation-control abuse bypasses or misuses mechanisms governing privileged execution.Making change happenAcceptance criteriaDefine observable conditions for a deliverable to be accepted.Security essentialsAccess controlUnderstand subjects, resources, permissions, and enforcement through a shared-drive example, including how access changes over time.Detection & responseAccess Token ManipulationAccess token manipulation changes or adopts operating-system security contexts.Risk & resilienceAccount Access RemovalAccount access removal disrupts legitimate users by changing, deleting, or restricting their identities.Evidence & investigationAccount DiscoveryAccount discovery enumerates identities available in a system or environment.Detection & responseAccount ManipulationAccount manipulation changes identity settings to preserve or expand access.Adversarial thinkingAcquire InfrastructureInfrastructure acquisition obtains domains, servers, or other resources used to support operations.Adversarial thinkingActive ScanningActive scanning probes target infrastructure to learn reachable services or weaknesses.Security essentialsAdversary in the middleAn intermediary may observe or alter a communication path.Security essentialsAESA symmetric block cipher whose safe use depends on its mode and implementation.Making change happenAgile deliveryUse short feedback cycles to adapt toward a useful outcome.