RocketChat / RocketChat/Rocket.Chat
Login protection sends duplicate block alerts and inconsistently records blocked failures
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
When Block_Multiple_Failed_Logins is enabled, two related problems can happen in the failed-login protection flow:
- Duplicate notifications: once threshold is exceeded, alert notifications can be sent repeatedly for the same still-blocked user/IP on subsequent attempts.
- Inconsistent failed-attempt persistence:
error-login-blocked-for-useris ignored from failed-attempt storage, buterror-login-blocked-for-ipis not, causing asymmetric telemetry.
Steps to reproduce:
- Enable these settings:
Block_Multiple_Failed_Logins_Enabled = trueBlock_Multiple_Failed_Logins_By_User = trueBlock_Multiple_Failed_Logins_By_Ip = trueBlock_Multiple_Failed_Logins_Notify_Failed = trueBlock_Multiple_Failed_Logins_Notify_Failed_Channel = <valid-channel>
- Set low thresholds (example: 3 attempts, unblock in 5 minutes).
- Trigger failed logins for a target user/IP until the threshold is exceeded.
- Keep trying login again during the block window.
- Observe notifications and server_events entries.
Expected behavior:
- Notification should be sent once per block window (or deduplicated for the same active block state), not repeatedly for each blocked retry.
- Blocked retries should be handled consistently for storage/telemetry (user-blocked and IP-blocked should follow the same rule).
Actual behavior:
- Repeated blocked retries can continue generating notifications.
error-login-blocked-for-useris ignored for failed-attempt storage, buterror-login-blocked-for-ipis not.
Server Setup Information:
- Version of Rocket.Chat Server: N/A (Codespaces/Gitpod dev environment)
- License Type: N/A
- Number of Users: N/A
- Operating System: N/A
- Deployment Method: Codespaces/Gitpod
- Number of Running Instances: N/A
- DB Replicaset Oplog: N/A
- NodeJS Version: N/A
- MongoDB Version: N/A
Client Setup Information
- Desktop App or Browser Version: N/A
- Operating System: N/A
Additional context
Related auth files:
apps/meteor/app/authentication/server/hooks/login.tsapps/meteor/app/authentication/server/lib/restrictLoginAttempts.tsapps/meteor/app/authentication/server/startup/index.js
Likely impact: noisy admin alerting + inconsistent login-attempt telemetry for risk reporting.
Relevant logs:
No external logs attached yet (local code-path analysis and reproducible behavior from current flow).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the failed-login flow through apps/meteor/app/authentication/server/hooks/login.ts and apps/meteor/app/authentication/server/lib/restrictLoginAttempts.ts, then inspect apps/meteor/app/authentication/server/startup/index.js. Verify how active user and IP blocks trigger notifications and failed-attempt storage; done means one notification per block window and consistent telemetry for both blocked error types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100