Disabling a user or downgrading their role terminates their live sessions, not just future logins
Why it matters
This evidences SOC 2 CC6.2, which requires that access is removed when no longer authorized: an auditor reads "removes access" to include in-flight sessions, not just the next login attempt. AI-generated apps fail this in a very specific way: the scaffold ships stateless JWTs with long lifetimes (next-auth defaults to 30 days) and an admin "ban user" route that flips a banned or is_active column, and nothing ever consults that column again until the token expires. The result is a deprovisioning gap where a fired employee, a compromised account, or a demoted admin keeps full live access for days or weeks after the org believes it was cut off. That gap is exactly what a SOC 2 auditor probes during the logical-access walkthrough ("show me what happens to an active session when you disable this user"), and it is the difference between a clean CC6.2 test and an exception in the report.
Severity rationale
High because a disabled or demoted user retains their full prior access for the entire remaining token or session lifetime, a live deprovisioning gap that defeats the point of the disable action; it is not critical because exploitation requires an account that was already legitimately provisioned.
Remediation
In every handler that disables a user or downgrades a role, revoke their live access in the same code path: call supabase.auth.admin.signOut(userId) (or clerkClient.sessions.revokeSession(...) per active session, or prisma.session.deleteMany({ where: { userId } }) for database sessions) immediately after the status write. If you are on stateless JWTs, either shorten the access-token lifetime to one hour or less and revoke refresh tokens on disable, or add a per-request check in middleware.ts that re-reads is_active and role from the database so stale sessions die on the next request.
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 SOC 2 Technical Readiness Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- soc2:2017 · CC6.2 — User registration, authorization, and access removal
- iso-27001:2022 · A.5.18 — Access rights
- nist:rev5 · AC-2 — Account Management
Taxons
History
- 2026-07-03·v1.0.0·Initial soc2-readiness v1 authoring; CC6.2 deprovisioning must cover in-flight sessions, so disable and role-downgrade paths need session revocation, short-lived tokens with refresh revocation, or per-request status re-reads.·by soc2-readiness-v1-build