Join our Newsletter — 33% off our NHI Course
Home› Guides› D3-WSAM Web Session Access Mediation: Securing Web Sessions…
Guide Network Security

D3-WSAM Web Session Access Mediation: Securing Web Sessions and Testing the Controls

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 12 November 2026 10 min read
On this page

After login, a web application trusts whatever presents the session token, so a weak session layer turns any stolen cookie into a working account. D3-WSAM Web Session Access Mediation is the MITRE D3FEND countermeasure for that layer. D3FEND describes it as securing user sessions in web applications through authentication, integrity validation and adaptive threat mitigation, so that access to web resources is authorised and protected from session-related attacks. It sits in the Isolate tactic as a child of Network Resource Access Mediation, isolates the Service Application Process artefact, and has two children: Endpoint-based and Proxy-based Web Server Access Mediation. This card covers what D3-WSAM includes, the ATT&CK relationships D3FEND records, where it is enforced, how to test it and where it stops helping. It is written for application security engineers, platform teams and detection engineers. For the parent technique, see D3-NRAM Network Resource Access Mediation.

Key takeaways

  • D3-WSAM is the umbrella for web session control. Its two children split enforcement between the user's endpoint (client certificates, endpoint agents) and an intermediary proxy.
  • The session token is the credential after login. Generation, cookie attributes, renewal on privilege change and server-side invalidation decide whether a stolen token stays useful.
  • D3FEND's ATT&CK data is inferred and broad. The ontology links the Service Application Process artefact directly to T1046 Network Service Discovery; the technique page adds inferred rows through sub-artefacts such as authentication services.
  • Timeouts and revocation are where most applications fall short. OWASP gives idle timeout examples of 2 to 5 minutes for high-value applications and 15 to 30 minutes for low-risk ones, enforced on the server.
  • Verify with session tests, not configuration review. Replay a logged-out token, change privilege mid-session and check cookie attributes in real responses.

D3-WSAM at a glance

FieldD3-WSAM Web Session Access Mediation
D3FEND IDD3-WSAM
TacticIsolate (via Network Resource Access Mediation and Access Mediation, which enables Isolate)
Parent techniqueNetwork Resource Access Mediation, D3-NRAM (sibling: Remote File Access Mediation)
ChildrenD3-EBWSAM Endpoint-based Web Server Access Mediation, D3-PBWSAM Proxy-based Web Server Access Mediation
Digital artefactService Application Process (D3FEND: the technique "isolates" it)
D3FEND referenceNIST SP 800-41 Rev. 1, Guidelines on Firewalls and Firewall Policy
Examples D3FEND givesAccess to corporate intranets, SaaS applications and online portals
Typical enforcement pointsApplication session layer, identity provider, reverse proxy or access gateway, endpoint certificate and agent checks
Main limitationA token stolen from a compliant, authenticated client can still look legitimate

How it works

D3FEND's knowledge base article lists three duties: authenticating users, maintaining session integrity, and protecting against threats such as session hijacking. Mapped onto a real application, those duties fall into four layers.

LayerControlSource of the value
Token generationSession IDs with at least 64 bits of entropy from a CSPRNG; 128 bits or more if you generate your ownOWASP Session Management Cheat Sheet
Token transport and storageCookies with Secure, HttpOnly and SameSite=Strict (preferred) or Lax; the __Host- prefix with no Domain attribute and Path=/; no session tokens in localStorage or sessionStorageOWASP cheat sheet; ASVS V3.3.1
LifecycleNew token at authentication and after any privilege change; idle and absolute timeouts enforced on the server; logout invalidates all tokens of the logical sessionOWASP cheat sheet; ASVS V7.2.4, V7.3.1, V7.3.2, V7.4.1
Verification and mediationEvery token checked by a trusted backend; per-request authorisation; anomaly checks on IP, user agent or client certificate changesASVS V7.2.1, V8.2.1; OWASP cheat sheet

OWASP gives example timeouts rather than fixed values: idle timeouts of 2 to 5 minutes for high-value applications and 15 to 30 minutes for low-risk ones, and an absolute timeout of 4 to 8 hours for a full working day. ASVS 5.0 asks for both timeouts to follow a documented risk decision. OWASP also treats binding a session to client IP or user agent as a detection signal rather than strong protection, because NAT, shared proxies and spoofed headers defeat it.

Endpoint-based and proxy-based mediation

The two children move enforcement out of the application. Endpoint-based mediation decides which devices may open a session, for example through client certificates or endpoint security software, so only managed laptops reach internal web applications. Proxy-based mediation puts an intermediary in front of the web resource that can authenticate, filter content and enforce access policy for every request. Zero trust access gateways combine both: a device check at the start and a proxy that evaluates each request. See D3-EBWSAM Endpoint-based Web Server Access Mediation, D3-PBWSAM Proxy-based Web Server Access Mediation and the ZTNA Guide.

Where identity and NHIs fit

Web sessions are not only human. Integrations, bots and AI agents that drive web applications hold session cookies or bearer tokens with the same power as a user's, often for much longer. The same lifecycle rules apply: short lifetimes, renewal, revocation on incident and binding to the client where the platform supports it. See D3-TB Token Binding and D3-TBA Token-based Authentication.

ATT&CK techniques D3FEND relates to D3-WSAM

Relationship type: inferred only. D3FEND has no hand-curated ATT&CK mapping for D3-WSAM. In the ontology, one technique acts directly on the Service Application Process artefact: T1046 Network Service Discovery, which enumerates it. The D3-WSAM technique page (D3FEND 1.6.0, checked November 2026) shows further inferred rows through sub-artefacts of Service Application Process, such as authentication, directory and mail services, and marks them experimental. Every ID below was checked against ATT&CK v20; the last column is NHI Mgmt Group's assessment.

ATT&CK IDTechniqueD3FEND relation (inferred via artefact)What D3-WSAM changes (NHI Mgmt Group assessment)
T1046Network Service DiscoveryEnumerates Service Application ProcessPartial: a proxy or gateway that requires authentication before any response hides application services from unauthenticated scanning
T1621Multi-Factor Authentication Request GenerationAbuses Remote Authentication ServicePartial: rate limits and number matching at the authentication step of the session
T1556Modify Authentication ProcessModifies Authentication ServiceMinimal: an attacker who changes the authentication service controls session issue
T1550Use Alternate Authentication MaterialAccesses Authentication ServicePartial: renewal, short lifetimes, server-side revocation and client binding reduce the window for replayed tokens
T1212Exploitation for Credential AccessMay access Authentication ServiceMinimal: depends on patching the service
T1003.001, T1003.002LSASS Memory, Security Account ManagerAccess Authentication ServiceNone directly: these act on the host, outside the web session
T1033System Owner/User DiscoveryMay access Directory ServiceMinimal
T1505.002Server Software Component: Transport AgentAdds Message Transfer Agent (mail service sub-artefact)None directly: a mail server persistence technique

The techniques D3-WSAM most directly frustrates in practice are not in D3FEND's list: T1539 Steal Web Session Cookie, T1185 Browser Session Hijacking and token replay after theft. See the MITRE ATT&CK T1539 Steal Web Session Cookie, MITRE ATT&CK T1185 Browser Session Hijacking and MITRE ATT&CK T1046 Network Service Discovery.

Implementation steps

  1. Inventory web applications and their session mechanisms. Record for each: who issues the session (application or identity provider), token type (opaque cookie or self-contained token), lifetimes and whether it sits behind a proxy or gateway.
  2. Fix token transport first. Set Secure, HttpOnly and SameSite on session cookies, use the __Host- prefix where possible, and remove tokens from browser storage. These changes are low risk and testable in a staging environment.
  3. Enforce lifecycle on the server. Regenerate the session ID at login and on privilege change, set idle and absolute timeouts from a documented risk decision, and make logout invalidate all tokens of the session. Coordinate with the identity provider: see the OpenID Connect Logout and Session Management Guide.
  4. Put mediation in front of internal applications. Route internal web applications through an authenticating proxy or access gateway, starting with administrative consoles. Pilot with one team, keep the direct path available behind an allow list for rollback, then close it.
  5. Add device conditions where the risk justifies it. Require a managed device or client certificate for administrative and high-value applications.
  6. Wire revocation into incident response. Make sure the SOC can revoke all sessions for a user, an application or a device in one action. See D3-ST Session Termination.

How to verify it works

  • Replay after logout: capture a session cookie in an authorised test, log out, and replay it. The server must reject it (ASVS V7.4.1).
  • Privilege change test: elevate a test user mid-session and confirm the session ID changes.
  • Timeout test: leave a session idle past the configured limit and confirm the server, not just the browser, ends it.
  • Cookie attribute check: inspect real Set-Cookie headers in production responses for Secure, HttpOnly, SameSite and prefix.
  • Bypass test: attempt to reach internal applications directly, without the proxy or gateway, from inside and outside the network.
  • Logging check: confirm session creation, renewal, destruction and timeout events are logged with a salted hash of the ID, not the raw token, as OWASP recommends.
MetricWhat it showsTarget direction
Applications with all session cookie attributes setTransport hardening coverageRising to 100%
Applications that pass the replay-after-logout testReal server-side invalidationRising to 100%
Internal web applications reachable without the gatewayMediation bypass pathsFalling toward zero
Time to revoke all sessions for a compromised userIncident response readinessFalling; minutes, not hours
Sessions seen from a new IP or user agent mid-sessionPossible hijacking signalsReviewed; feed into D3-WSAA Web Session Activity Analysis

Limits, bypasses and failure patterns

  • Token theft from a trusted client: infostealer malware on a managed device takes cookies that pass every device and session check. Short lifetimes, client binding and fast revocation are the response. See the Session Hijacking and Cookie Theft Guide.
  • Session state outside the mediator: a gateway that authenticates once and passes requests through cannot revoke an application's own long-lived session.
  • Logout that only clears the browser: the cookie is deleted client side but stays valid on the server.
  • Tokens that survive a password reset: existing sessions are not revoked when credentials change after a compromise.
  • Direct paths around the proxy: applications still reachable by IP address or a legacy hostname.
  • Raw session IDs in logs: logs become a source of live tokens.

Framework mapping

FrameworkReferenceRelationship to D3-WSAM
OWASP ASVS 5.0V7.2.1, V7.2.4, V7.3.1, V7.3.2, V7.4.1, V3.3.1Session verification, renewal, timeouts, termination, cookie attributes
NIST SP 800-53 Rev 5AC-12, SC-23, AC-17, IA-11Session termination, session authenticity, remote access, re-authentication
NIST CSF 2.0PR.AA-03, PR.IR-01Authentication; protection of networks and environments from unauthorised logical access
NIST SP 800-41 Rev. 1Firewall and proxy policyThe reference D3FEND cites for D3-WSAM and its children

Practitioner checklist

  • Inventory web applications with their session issuer, token type, lifetimes and mediation path.
  • Set Secure, HttpOnly and SameSite on session cookies and use the __Host- prefix where possible.
  • Regenerate session IDs at login and on every privilege change.
  • Enforce idle and absolute timeouts on the server from a documented risk decision.
  • Make logout and password reset revoke all sessions on the server.
  • Put internal and administrative web applications behind an authenticating proxy or gateway and close direct paths.
  • Give the SOC a one-step way to revoke sessions per user, application or device.
  • Log session lifecycle events with hashed IDs and alert on mid-session client changes.

Standards and references

Related NHI Mgmt Group resources: D3-NRAM Network Resource Access Mediation · MITRE D3FEND Access Mediation Implementation Guide · Session Hijacking and Cookie Theft Guide · ZTNA Guide · MITRE D3FEND Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 12 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.