[PR #2528] fix: require password confirmation for account deletion #2370

Open
opened 2026-02-26 20:33:35 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/2528
Author: @elweb-3
Created: 2/22/2026
Status: 🔄 Open

Base: mainHead: bounty/issue-2461


📝 Commits (1)

  • 0a27085 fix: require password confirmation for account deletion

📊 Changes

3 files changed (+45 additions, -7 deletions)

View changed files

📝 apps/remix/app/components/dialogs/account-delete-dialog.tsx (+17 -2)
📝 packages/trpc/server/profile-router/router.ts (+22 -5)
📝 packages/trpc/server/profile-router/schema.ts (+6 -0)

📄 Description

Summary

Resolves #2461 — Account deletion now requires the user to enter their current password before the account can be deleted.

Problem

The account deletion flow allowed a user (or an attacker with session access) to delete an account without requiring password re-authentication. This is a high-severity security issue for a destructive, irreversible operation.

Changes

  • packages/trpc/server/profile-router/schema.ts — Added ZDeleteAccountMutationSchema with required password field
  • packages/trpc/server/profile-router/router.tsdeleteAccount mutation now verifies password via verifyPassword (bcrypt) before proceeding. Returns UNAUTHORIZED error on mismatch.
  • apps/remix/app/components/dialogs/account-delete-dialog.tsx — Added password input field to the delete confirmation dialog. Delete button is disabled until password is entered.

Security Impact

  • Prevents unauthorized account deletion by attackers with session access (e.g., XSS, session hijacking)
  • Uses existing verifyPassword utility (bcrypt comparison) — no new dependencies
  • Password field is always required, regardless of 2FA status

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/2528 **Author:** [@elweb-3](https://github.com/elweb-3) **Created:** 2/22/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `bounty/issue-2461` --- ### 📝 Commits (1) - [`0a27085`](https://github.com/documenso/documenso/commit/0a27085e1e3b988ff7c08a118dcc3f28b21fedc7) fix: require password confirmation for account deletion ### 📊 Changes **3 files changed** (+45 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `apps/remix/app/components/dialogs/account-delete-dialog.tsx` (+17 -2) 📝 `packages/trpc/server/profile-router/router.ts` (+22 -5) 📝 `packages/trpc/server/profile-router/schema.ts` (+6 -0) </details> ### 📄 Description ## Summary Resolves #2461 — Account deletion now requires the user to enter their current password before the account can be deleted. ## Problem The account deletion flow allowed a user (or an attacker with session access) to delete an account without requiring password re-authentication. This is a high-severity security issue for a destructive, irreversible operation. ## Changes - **`packages/trpc/server/profile-router/schema.ts`** — Added `ZDeleteAccountMutationSchema` with required `password` field - **`packages/trpc/server/profile-router/router.ts`** — `deleteAccount` mutation now verifies password via `verifyPassword` (bcrypt) before proceeding. Returns `UNAUTHORIZED` error on mismatch. - **`apps/remix/app/components/dialogs/account-delete-dialog.tsx`** — Added password input field to the delete confirmation dialog. Delete button is disabled until password is entered. ## Security Impact - Prevents unauthorized account deletion by attackers with session access (e.g., XSS, session hijacking) - Uses existing `verifyPassword` utility (bcrypt comparison) — no new dependencies - Password field is always required, regardless of 2FA status --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#2370
No description provided.