Location Research Breakthrough Possible @S-Logix pro@slogix.in

Executing Stolen Session Token Replay Attacks Against Pomerium Zero Trust Access Proxy Through Continuous Identity and Session Validation

Description

Modern organizations increasingly use Zero Trust Network Access (ZTNA) architectures to provide secure access to internal applications without automatically trusting users or network locations.

Zero Trust follows the principle of "never trust, always verify", meaning that authentication and authorization decisions should continuously enforce access policies rather than assuming that an already-authenticated session remains trustworthy indefinitely.

Pomerium is an open-source identity-aware access proxy that can be used to protect internal applications through identity-based access policies.

However, if a valid authenticated session token is stolen, an attacker may attempt to reuse the token from another client to access a protected application.

This creates a session-token replay risk because the attacker may possess a credential that was legitimately issued to another user or session.

In this use case, Pomerium is deployed as the controlled Zero Trust access proxy on an Ubuntu Linux virtual machine inside an isolated VirtualBox laboratory.

A controlled protected web application is placed behind Pomerium.

A legitimate test user authenticates through the Zero Trust access layer and establishes a valid session. A controlled session-token replay scenario is then performed using a laboratory test token.

The assessment evaluates whether the Zero Trust architecture can identify abnormal reuse of an authenticated session and whether additional identity, session, and access-policy controls can prevent continued unauthorized access.

Open Policy Agent (OPA) is used to support policy-based authorization decisions. osquery provides endpoint and device-state information. Wazuh provides security monitoring, while OpenSearch is used for centralized investigation and event correlation.

After identifying the session-replay weakness, the access policy is strengthened using session controls and continuous identity validation. The same controlled token-replay scenario is then repeated to verify that unauthorized session reuse is prevented while legitimate users continue to access protected applications.

The complete Zero Trust workflow is: Protected Application → Pomerium Zero Trust Access → Legitimate Authentication → Session Establishment → Controlled Session Token Replay → Continuous Verification → Anomalous Session Detection → Access Restriction → Policy Remediation → Retesting → Zero Trust Validation

Existing Security Problem

Application: Pomerium Zero Trust Access Proxy

Pomerium is the real open-source Zero Trust access-proxy platform used in this project. It provides identity-aware access control for protected applications.

Existing Problem:

A user who successfully authenticates to a protected application receives an authenticated session. If the corresponding session token is stolen, an attacker may attempt to reuse that token from another client. Traditional authentication may consider the token valid because it was originally issued legitimately. A Zero Trust architecture should instead evaluate whether the current request, identity, session, device, and access context continue to satisfy the security policy.

The security problem is therefore:

Legitimate User → Successful Authentication → Valid Session Token → Token Stolen → Attacker Reuses Token → Protected Application → Unauthorized Session Access

Attack

Specific Attack: Stolen Session Token Replay

The controlled attack scenario evaluates whether a stolen authenticated session token can be reused by another laboratory client to access a protected application.

Attack Behavior:
Legitimate Test User
→
Pomerium Authentication
→
Valid Authenticated Session
→
Controlled Session Token Captured
→
Unauthorized Test Client
→
Session Token Replay
→
Pomerium Access Request
→
Session Accepted
→
Protected Application Access
→
Security Event
→
Continuous Verification
→
Session Restriction
→
Retesting
→
Replay Prevented

Security Concept

Continuous Verification and Context-Aware Access Control:

The primary Zero Trust security concept is Continuous Verification.

A successful authentication event should not create unlimited trust. Instead, access should continuously depend on: Identity + Session + Device + Request Context + Access Policy -> Authorization Decision. The objective is to ensure that a valid token alone does not provide indefinite trust to an unknown or unauthorized client.

The secure processing flow is:

User Request
→
Identity Verification
→
Session Validation
→
Device / Context Evaluation
→
Policy Evaluation
→
Authorization Decision
→
Protected Application
→
Continuous Monitoring

Defensive Mechanism

Continuous Identity Verification

The user's identity is continuously evaluated when accessing protected applications.

Purpose

Prevent previously authenticated identities from being trusted indefinitely.

Session Validation

Authenticated sessions are validated according to the configured session policy.

Purpose

Prevent unauthorized reuse of stale or stolen sessions.

Short Session Lifetime

Authenticated sessions are configured with an appropriate lifetime.

Purpose

Reduce the useful lifetime of a stolen session.

Session Revocation

Suspicious or compromised sessions can be invalidated.

Purpose

Prevent continued use of a compromised session.

Context-Aware Access Control

Access decisions consider request context in addition to authentication status.

Purpose

Prevent a valid session from automatically being trusted from an unexpected context.

Device-State Verification

Endpoint information is collected to support device-trust decisions.

Purpose

Identify whether the request originates from an expected security posture.

Policy-Based Authorization

Open Policy Agent supports policy evaluation for protected access decisions.

Purpose

Enforce explicit authorization policies instead of implicit trust.

Session Anomaly Monitoring

Repeated or unusual session reuse is monitored.

Purpose

Identify potential session-token replay.

Security Monitoring

Wazuh collects relevant authentication and access activity.

Purpose

Provide centralized visibility into suspicious access behavior.

Centralized Investigation

OpenSearch is used to correlate identity, session, and endpoint events.

Purpose

Establish the timeline of a suspected session-replay incident.

Post-Remediation Validation

The original session-replay scenario is repeated after remediation.

Purpose

Confirm that the Zero Trust controls prevent unauthorized session reuse.

Security Tools

Target Zero Trust Platform: Pomerium

Pomerium is the primary Zero Trust access-proxy platform.

Purpose
  • Protect internal applications.
  • Enforce identity-aware access.
  • Establish authenticated sessions.
  • Apply access policies.
  • Control access to protected applications.

Policy Enforcement Tool: Open Policy Agent

Open Policy Agent (OPA) is used for policy-based authorization.

Purpose
  • Define authorization policies.
  • Evaluate request context.
  • Enforce explicit access conditions.
  • Support context-aware authorization.

Endpoint State Monitoring Tool: osquery

osquery is used to collect endpoint and device-state information.

Purpose
  • Collect host information.
  • Identify endpoint state.
  • Monitor relevant system configuration.
  • Provide device-context information for Zero Trust decisions.

Security Monitoring Tool: Wazuh

Wazuh is used for centralized security monitoring.

Purpose
  • Monitor Pomerium-related activity.
  • Monitor Ubuntu security events.
  • Collect authentication activity.
  • Detect suspicious session behavior.
  • Generate security alerts.

Security Investigation Platform: OpenSearch

OpenSearch is used for centralized investigation.

Purpose
  • Search authentication events.
  • Correlate session activity.
  • Review endpoint information.
  • Investigate suspicious access.
  • Establish the session-replay timeline.

Protected Application: Internal Web Application

A controlled web application is placed behind Pomerium.

Purpose
  • Represent a protected enterprise application.
  • Provide a resource requiring Zero Trust access.
  • Generate legitimate authenticated activity.
  • Validate authorized and unauthorized access behavior.

Target Platform: Ubuntu Linux

Ubuntu hosts the Pomerium environment and protected application.

Purpose
  • Run Pomerium.
  • Host the protected application.
  • Generate authentication and system activity.
  • Support security monitoring.

Security Testing Platform: Kali Linux

Kali Linux provides the controlled security-testing environment.

Purpose
  • Perform the session-replay assessment.
  • Generate controlled access requests.
  • Validate session controls.
  • Perform post-remediation testing.

Virtualization Platform: VirtualBox

VirtualBox provides the isolated Zero Trust laboratory.

Purpose
  • Host Ubuntu.
  • Host Kali Linux.
  • Provide isolated networking.
  • Maintain a reproducible Zero Trust security environment.

Process

STEP 01

Step 1: Prepare the Isolated Zero Trust Laboratory

  • Install VirtualBox.
  • Create an Ubuntu virtual machine.
  • Create a Kali Linux virtual machine.
  • Configure an isolated virtual network.
  • Assign laboratory IP addresses.
  • Verify communication between the virtual machines.
  • Ensure the environment is isolated from production systems.
Tools: VirtualBox + Ubuntu + Kali Linux
STEP 02

Step 2: Deploy Pomerium

  • Install Pomerium on Ubuntu.
  • Start the Pomerium service.
  • Verify that the access proxy is operational.
  • Configure the required laboratory domain.
  • Verify that Pomerium can receive access requests.
  • Record the initial configuration.
Tools: Pomerium
STEP 03

Step 3: Deploy the Protected Application

  • Deploy a simple controlled web application on Ubuntu.
  • Configure the application behind Pomerium.
  • Prevent direct access to the protected application where appropriate.
  • Verify that normal requests pass through Pomerium.
  • Confirm that the application is accessible only through the Zero Trust access layer.
Tools: Pomerium + Ubuntu
STEP 04

Step 4: Establish the Legitimate Identity Baseline

  • Create the controlled laboratory user identity.
  • Configure the identity provider required by the laboratory.
  • Authenticate the legitimate user through Pomerium.
  • Verify successful access to the protected application.
  • Record the identity and session behavior.
Tools: Pomerium + Ubuntu
STEP 05

Step 5: Establish the Secure Session Baseline

  • Review the authenticated session behavior.
  • Identify the session lifetime.
  • Identify relevant session attributes.
  • Record the legitimate client information.
  • Verify that the authorized session can access the protected application.
  • Preserve the baseline for comparison.
Tools: Pomerium
STEP 06

Step 6: Configure Zero Trust Access Policies

  • Define the protected application access policy.
  • Specify the identities permitted to access the application.
  • Define the required contextual access conditions.
  • Apply least-privilege access.
  • Verify authorized access.
  • Verify restricted access.
Tools: Pomerium + Open Policy Agent
STEP 07

Step 7: Configure Endpoint State Monitoring

  • Install osquery on the laboratory endpoints.
  • Configure relevant endpoint-state queries.
  • Collect system information.
  • Record the baseline device state.
  • Identify the authorized test endpoint.
  • Preserve the endpoint-state baseline.
Tools: osquery
STEP 08

Step 8: Configure Continuous Security Monitoring

  • Configure Wazuh to monitor relevant Ubuntu and Pomerium activity.
  • Configure monitoring for authentication events.
  • Configure monitoring for access-policy activity.
  • Verify that security events are collected.
  • Establish the normal monitoring baseline.
Tools: Wazuh
STEP 09

Step 9: Establish Normal Protected-Application Access

  • Authenticate the legitimate laboratory user.
  • Access the protected application.
  • Generate normal application activity.
  • Record the session behavior.
  • Review the corresponding Wazuh events.
  • Confirm that legitimate access remains functional.
Tools: Pomerium + Wazuh
STEP 10

Step 10: Perform the Controlled Session-Token Capture

  • Within the isolated laboratory:
  • Use the designated legitimate test session.
  • Identify the controlled session token used by the laboratory application.
  • Preserve only the synthetic laboratory token.
  • Record the session context.
  • Do not capture or use real credentials or production sessions.
  • The token exists only for the controlled security assessment.
Tools: Pomerium + Kali Linux
STEP 11

Step 11: Perform the Controlled Session Token Replay

  • Using the designated unauthorized laboratory client:
  • Present the controlled test session token.
  • Submit a request to the protected application.
  • Observe the Pomerium access decision.
  • Record whether the session is accepted.
  • Record the response.
  • Stop the test after sufficient evidence is collected.
Tools: Kali Linux + Pomerium
STEP 12

Step 12: Analyze the Session-Replay Activity

  • Compare the legitimate session with the replayed session.
  • Review client information.
  • Review session timestamps.
  • Review request source information.
  • Determine whether the same session was reused from an unexpected context.
  • Document the observed behavior.
Tools: Pomerium + OpenSearch
STEP 13

Step 13: Detect the Security Event

  • Review Wazuh events associated with the replayed session.
  • Identify repeated or abnormal session activity.
  • Review authentication and access events.
  • Identify the affected protected application.
  • Record the detection evidence.
  • Determine whether the event satisfies the session-replay detection condition.
Tools: Wazuh
STEP 14

Step 14: Investigate the Session-Replay Incident

  • Open the relevant Wazuh events in OpenSearch.
  • Review the legitimate authentication event.
  • Review the replayed session activity.
  • Correlate timestamps.
  • Compare client and endpoint context.
  • Identify the sequence of events.
  • Establish the incident timeline.
Tools: Wazuh + OpenSearch + osquery
STEP 15

Step 15: Assess the Zero Trust Risk

  • Evaluate:
  • Session-token lifetime.
  • Session reuse.
  • Identity verification.
  • Device context.
  • Access policy.
  • Request source.
  • Protected application sensitivity.
  • Monitoring visibility.
  • Potential unauthorized access.
  • Remediation requirements.
  • Assign an appropriate security risk level.
Tools: Pomerium + OPA + Wazuh + OpenSearch
STEP 16

Step 16: Remediate the Session-Replay Weakness

  • Reduce the session lifetime where appropriate.
  • Configure stronger session validation.
  • Enable session revocation controls where supported.
  • Strengthen contextual access policies.
  • Require appropriate device/context conditions.
  • Update OPA authorization policies where applicable.
  • Verify the corrected Zero Trust configuration.
Tools: Pomerium + Open Policy Agent + osquery
STEP 17

Step 17: Retest Unauthorized and Authorized Access

  • Unauthorized Session Replay Retest
  • Use the same controlled laboratory session token.
  • Repeat the replay request from the unauthorized test client.
  • Verify that the request is rejected or restricted.
  • Record the result.
  • Authorized Access Retest
  • Authenticate using the legitimate laboratory identity.
  • Establish a new valid session.
  • Access the protected application.
  • Verify that legitimate access continues to function.
Tools: Kali Linux + Pomerium + Wazuh
STEP 18

Step 18: Perform Final Zero Trust Security Validation

  • Review the original session-replay evidence.
  • Review Pomerium access logs.
  • Review OPA policy results.
  • Review osquery endpoint-state information.
  • Review Wazuh security events.
  • Review OpenSearch investigation results.
  • Compare the original and remediated session behavior.
  • Confirm that the replayed session is rejected or restricted.
  • Confirm that legitimate users continue to access the protected application.
  • Document the final Zero Trust Security assessment.
Tools: Pomerium + Open Policy Agent + osquery + Wazuh + OpenSearch + Kali Linux

Outcome

  1. A real Pomerium Zero Trust access environment is successfully deployed on Ubuntu, providing a practical open-source platform for demonstrating Zero Trust security principles.
  2. A controlled protected web application is successfully placed behind the Pomerium access layer, establishing an identity-aware application-access environment.
  3. A legitimate authenticated laboratory session is successfully established, providing the baseline required for controlled session-replay testing.
  4. A controlled stolen-session-token replay scenario is successfully reproduced, demonstrating the risk of relying solely on possession of a valid session token.
  5. Pomerium and the associated monitoring environment provide visibility into session and access activity, allowing suspicious session reuse to be investigated.
  6. Wazuh and OpenSearch support centralized detection and investigation, allowing analysts to correlate authentication, session, endpoint, and access events.
  7. Open Policy Agent and osquery support context-aware Zero Trust enforcement, strengthening authorization beyond simple token possession.
  8. Session lifetime, session validation, and contextual access policies are strengthened, reducing the opportunity for unauthorized session reuse.
  9. Post-remediation testing confirms that the controlled replayed session is rejected or restricted while legitimate users continue to access the protected application, validating the implemented Zero Trust controls.
  10. The complete Zero Trust identity verification, session-token replay assessment, continuous verification, context-aware authorization, endpoint-state validation, security monitoring, investigation, remediation, and post-remediation validation workflow is successfully demonstrated.