fix: Resend Verification Email Can Be Abused to Spam Mail Server #35971
fix: Resend Verification Email Can Be Abused to Spam Mail Server #35971ggazzo merged 17 commits intoRocketChat:developfrom
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: c0f81f4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 40 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
…021/Rocket.Chat into fix/verification-email-rate-limit
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
If someone reviews this code, it will be greatly appreciated. |
WalkthroughImplements rate limiting on the email verification resend endpoint to prevent abuse. The fix constrains the endpoint to accept one request per minute, addressing the security vulnerability where unlimited rapid requests could spam mail servers. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. No actionable comments were generated in the recent review. 🎉 📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: Kevin Aleman <kaleman960@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #35971 +/- ##
===========================================
- Coverage 70.42% 70.41% -0.01%
===========================================
Files 3174 3174
Lines 111005 111005
Branches 20005 19965 -40
===========================================
- Hits 78179 78168 -11
- Misses 30780 30797 +17
+ Partials 2046 2040 -6
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
hey @JASIM0021 it took a while but its done, would you mind accepting the CLA? |
✅ |
fix: Resend Verification Email Can Be Abused to Spam Mail Server
closes: #35965
Proposed changes (including videos or screenshots)
Attempt to send multiple emails within 1 minute

User receives error indicating rate limit is enforced:
After 1 minute, user is allowed to resend

The rate limit resets and the email is sent successfully:
Rate Limiting on
users.sendConfirmationEmailAPITo prevent abuse of the
users.sendConfirmationEmailendpoint (such as email spamming and server overload), a rate limiter has been implemented .Issue(s)
closes #35965
Steps to test or reproduce
Navigate to: https:///account/profile
Below the email input, there's a "Resend Verification Email" button.
Click the button 3–4 times — you’ll receive an Error message.
Further comments
Pull Request Description
This pull request addresses an issue where the "Resend Verification Email" feature could be exploited to spam the mail server. The changes introduce a rate limiting mechanism for confirmation email requests. Specifically, the implementation tracks the timestamp of the last sent email and enforces a minimum wait time between subsequent requests. This update is made in the
apps/meteor/app/api/server/v1/users.tsfile. The source branch for this fix isfix/verification-email-rate-limit, and it is targeted to be merged into thedevelopbranch.Summary by CodeRabbit