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
| Field | D3-WSAM Web Session Access Mediation |
|---|---|
| D3FEND ID | D3-WSAM |
| Tactic | Isolate (via Network Resource Access Mediation and Access Mediation, which enables Isolate) |
| Parent technique | Network Resource Access Mediation, D3-NRAM (sibling: Remote File Access Mediation) |
| Children | D3-EBWSAM Endpoint-based Web Server Access Mediation, D3-PBWSAM Proxy-based Web Server Access Mediation |
| Digital artefact | Service Application Process (D3FEND: the technique "isolates" it) |
| D3FEND reference | NIST SP 800-41 Rev. 1, Guidelines on Firewalls and Firewall Policy |
| Examples D3FEND gives | Access to corporate intranets, SaaS applications and online portals |
| Typical enforcement points | Application session layer, identity provider, reverse proxy or access gateway, endpoint certificate and agent checks |
| Main limitation | A 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.
| Layer | Control | Source of the value |
|---|---|---|
| Token generation | Session IDs with at least 64 bits of entropy from a CSPRNG; 128 bits or more if you generate your own | OWASP Session Management Cheat Sheet |
| Token transport and storage | Cookies with Secure, HttpOnly and SameSite=Strict (preferred) or Lax; the __Host- prefix with no Domain attribute and Path=/; no session tokens in localStorage or sessionStorage | OWASP cheat sheet; ASVS V3.3.1 |
| Lifecycle | New token at authentication and after any privilege change; idle and absolute timeouts enforced on the server; logout invalidates all tokens of the logical session | OWASP cheat sheet; ASVS V7.2.4, V7.3.1, V7.3.2, V7.4.1 |
| Verification and mediation | Every token checked by a trusted backend; per-request authorisation; anomaly checks on IP, user agent or client certificate changes | ASVS 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 ID | Technique | D3FEND relation (inferred via artefact) | What D3-WSAM changes (NHI Mgmt Group assessment) |
|---|---|---|---|
| T1046 | Network Service Discovery | Enumerates Service Application Process | Partial: a proxy or gateway that requires authentication before any response hides application services from unauthenticated scanning |
| T1621 | Multi-Factor Authentication Request Generation | Abuses Remote Authentication Service | Partial: rate limits and number matching at the authentication step of the session |
| T1556 | Modify Authentication Process | Modifies Authentication Service | Minimal: an attacker who changes the authentication service controls session issue |
| T1550 | Use Alternate Authentication Material | Accesses Authentication Service | Partial: renewal, short lifetimes, server-side revocation and client binding reduce the window for replayed tokens |
| T1212 | Exploitation for Credential Access | May access Authentication Service | Minimal: depends on patching the service |
| T1003.001, T1003.002 | LSASS Memory, Security Account Manager | Access Authentication Service | None directly: these act on the host, outside the web session |
| T1033 | System Owner/User Discovery | May access Directory Service | Minimal |
| T1505.002 | Server Software Component: Transport Agent | Adds 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
- 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.
- 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.
- 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.
- 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.
- Add device conditions where the risk justifies it. Require a managed device or client certificate for administrative and high-value applications.
- 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.
| Metric | What it shows | Target direction |
|---|---|---|
| Applications with all session cookie attributes set | Transport hardening coverage | Rising to 100% |
| Applications that pass the replay-after-logout test | Real server-side invalidation | Rising to 100% |
| Internal web applications reachable without the gateway | Mediation bypass paths | Falling toward zero |
| Time to revoke all sessions for a compromised user | Incident response readiness | Falling; minutes, not hours |
| Sessions seen from a new IP or user agent mid-session | Possible hijacking signals | Reviewed; 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
| Framework | Reference | Relationship to D3-WSAM |
|---|---|---|
| OWASP ASVS 5.0 | V7.2.1, V7.2.4, V7.3.1, V7.3.2, V7.4.1, V3.3.1 | Session verification, renewal, timeouts, termination, cookie attributes |
| NIST SP 800-53 Rev 5 | AC-12, SC-23, AC-17, IA-11 | Session termination, session authenticity, remote access, re-authentication |
| NIST CSF 2.0 | PR.AA-03, PR.IR-01 | Authentication; protection of networks and environments from unauthorised logical access |
| NIST SP 800-41 Rev. 1 | Firewall and proxy policy | The 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
- MITRE D3FEND: Web Session Access Mediation (D3-WSAM)
- OWASP: Session Management Cheat Sheet
- OWASP: Application Security Verification Standard 5.0
- NIST: SP 800-41 Rev. 1, Guidelines on Firewalls and Firewall Policy
- NIST: SP 800-53 Rev 5, Security and Privacy Controls
- NIST: Cybersecurity Framework 2.0
- MITRE ATT&CK: T1046 Network Service Discovery
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