Sensitive Operations Require Re-authentication
Why it matters
Sensitive account operations — password change, email change, account deletion, MFA modification — that execute with only a valid session cookie are fully exploitable by session hijacking or CSRF. An attacker who steals a session token can change the account email, locking out the legitimate owner permanently. CWE-306 (Missing Authentication for Critical Function) and CWE-308 (Use of Single-Factor Authentication for a Critical Action) define this failure. OWASP A07 (Identification and Authentication Failures) covers it. NIST 800-53 IA-11 (Re-Authentication) explicitly requires fresh authentication for high-impact operations. Re-authentication limits the stolen-session blast radius to read-only access.
Severity rationale
High because a stolen session cookie enables permanent account takeover through email address change without any additional credential, with no recovery path for the victim.
Remediation
Require current password verification before executing sensitive account changes. This ensures a stolen session alone is insufficient for full account takeover.
// app/api/account/change-password/route.ts
export async function POST(req: NextRequest) {
const session = await auth();
if (!session) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
const { currentPassword, newPassword } = await req.json();
const user = await db.user.findUnique({ where: { id: session.user.id } });
const isValid = await bcrypt.compare(currentPassword, user!.passwordHash);
if (!isValid) return NextResponse.json({ error: 'Invalid current password' }, { status: 403 });
const newHash = await bcrypt.hash(newPassword, 12);
await db.user.update({ where: { id: session.user.id }, data: { passwordHash: newHash } });
}
For email changes, send a confirmation link to the current address rather than applying the change immediately — this gives the account owner a chance to block an unauthorized change.
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 Authorization Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-306 — Missing Authentication for Critical Function
- cwe · CWE-308 — Use of Single-Factor Authentication
- owasp:2021 · A07
- nist:rev5 · IA-11 — Re-Authentication
Taxons
History
- 2026-04-18·v1.0.0·Initial import from saas-authorization·automated