Account deletion confirmed with cooling-off period
Why it matters
Instant, irreversible account deletion with a single confirmation click is a UX failure that creates real harm — users can accidentally delete years of content, and phishing attacks can trick users into triggering deletion. GDPR Art. 17 does not require immediate deletion; a grace period is both compliant and protective. Without a cooling-off window and email confirmation, there is no mechanism to detect unauthorized deletion requests (e.g., from a stolen session token) before the damage is permanent.
Severity rationale
High because irreversible instant deletion with no grace period eliminates the only practical safeguard against accidental or malicious account removal.
Remediation
Schedule deletion rather than executing it immediately. Create a deletion_requests table, send a confirmation email, and run the actual erasure only after the grace period expires. In src/app/api/account/delete/route.ts:
async function initiateAccountDeletion(userId: string, userEmail: string) {
const scheduledFor = new Date();
scheduledFor.setDate(scheduledFor.getDate() + 30); // 30-day grace
const request = await db.deletionRequest.create({
data: { userId, status: 'pending', scheduledFor, confirmationToken: generateToken() }
});
await sendEmail({
to: userEmail,
subject: 'Confirm account deletion',
body: `Your account is scheduled for deletion on ${scheduledFor.toDateString()}. Cancel here: ${baseUrl}/account/deletion-cancel?token=${request.confirmationToken}`
});
return request;
}
Run a daily cron job that processes deletionRequests where scheduledFor < NOW() and status = 'confirmed', then invokes the full erasure logic.
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 Community Privacy & Controls Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- gdpr · Art. 17 — Right to erasure ('right to be forgotten')
- ccpa · §1798.105 — Right to delete personal information
- iso-27001:2022 · A.8.10 — Information deletion
Taxons
History
- 2026-04-18·v1.0.0·Initial import from community-privacy-controls·automated