PasswordResetToken rows are never deleted after use, inconsistent with OTPToken cleanup
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- authentication, database
Hướng nghiên cứu
Read application/backend/src/controllers/UsersController.ts around resetPassword, then compare its token handling with AuthController.loginOtp and the OTPToken deletion described in the issue. Decide and implement consistent cleanup for used password-reset tokens; verify the reset flow no longer leaves used rows behind.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
UsersController.resetPassword in application/backend/src/controllers/UsersController.ts marks a used token via passwordResetTokenRepo.update({ ..., data: { used: true } }) but never deletes the row. Every password reset ever completed sits in the PasswordResetToken table indefinitely, and there's no scheduled cleanup for used or expired tokens either.
Meanwhile, in the same codebase, AuthController.loginOtp explicitly deletes the OTP token on use: await prisma.oTPToken.delete({ where: { id: otp.id } }). So there are two auth tokens with two different retention policies in the same file tree, presumably not deliberately.
Impact:
- Storage growth is unbounded over time. Probably minor at CTRL's current scale but grows forever.
- Minor data-exposure surface: a DB dump reveals when each user reset their password (userId + timestamp trails), even after the tokens themselves are
used: trueand useless for a real reset attempt.
- Ngôn ngữ chính
- TypeScript
- Star
- 4
- Fork
- 0
- Merge trung bình
- 14 giờ 50 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Garvan-Data-Science-Platform/ctrl
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
-
admin-client backend bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
backend bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Garvan-Data-Science-Platform/ctrl#970 · 1 bình luận ·
-
backend bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
backend bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Tất cả issue của Garvan-Data-Science-Platform/ctrl
Issue tương tự
-
enhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OWASP/cve-lite-cli#1335 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Windows: main-screen mouse tracking requires WT_SESSION, so it never enables inside herdr panesĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 66/100
code-yeongyu/senpi#3353 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Channels status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
mastra-ai/mastra#27093 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement needs-triage ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày