Session expiry is configured with a reasonable timeout
Why it matters
A session with no expiry or a 90-day timeout hands attackers an indefinitely valid credential from a single stolen cookie. NIST 800-63B §7.2 and PCI-DSS Req-8.2.8 both require session termination after a defined inactivity period — for good reason. A user who forgets to log out on a shared machine, or whose cookie is skimmed from an insecure connection, can have their account accessed for weeks or months with no recourse. OWASP A07 specifically lists insufficient session expiration as an authentication failure vector.
Severity rationale
High because a non-expiring or excessively long-lived session token gives an attacker durable account access that persists long after the original compromise.
Remediation
Set an explicit session lifetime rather than relying on a framework default that may be undocumented. For general SaaS, 7 days is a reasonable balance between security and UX; for finance or health apps, use 24 hours or less:
// NextAuth example in authOptions
session: {
strategy: 'jwt',
maxAge: 7 * 24 * 60 * 60, // 7 days
updateAge: 24 * 60 * 60, // extend on activity
}
Pair short session lifetimes with refresh token rotation so active users are not logged out while dormant sessions are expired.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Authentication Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-613 — Insufficient Session Expiration
- owasp:2021 · A07
- nist:rev4 · SP-800-63B §7.2 — Reauthentication
- pci-dss:4.0 · Req 8.2.8
- soc2:2017 · CC6.1 — Logical access security software, infrastructure, and architectures
Taxons
History
- 2026-04-18·v1.0.0·Initial import from saas-authentication·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC6.1) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2