RocketChat / RocketChat/Rocket.Chat

Failed login attempts count not reset according to time settings

Open
#26,787 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

Users who have failed logging in too many times, and have therefore been blocked, are perpetually blocked instead of actually reset after the block timeout.

Seems related to: https://forums.rocket.chat/t/ip-blocked-temporary/10932 and https://github.com/RocketChat/Rocket.Chat/issues/20088

Steps to reproduce:
  1. Ensure that there are limits per user and IP address, e.g. max 2 failed attempts and 1 minute lockout.
  2. Enable two-factor via email
  3. Log failed logins to a channel, so that you can see what happens (instead of the very noisy log function)
  4. Create a user
  5. Send them a password reset link
  6. Fail logging in
  7. Repeat
  8. Watch them be blocked for every failed attempt after the second, even though they wait more than 1 minute.
Expected behavior:

Failed login count for both IP address and user should be reset to zero when the blocking time has timed out.

Actual behavior:

User gets locked out, either by IP or username, every time.

rocket-chat-user-attempts-20220902

Work-around:

Disable two-factor authentication via email.

Server Setup Information:
  • Version of Rocket.Chat Server: 4.8.3
  • Operating System: Debian Bullseye
  • Deployment Method: snap
  • Number of Running Instances: 1
  • NodeJS Version: v14.18.3
  • MongoDB Version: 4.2.17 / wiredTiger (oplog Enabled)
Client Setup Information
  • Desktop App or Browser Version: Firefox 104.1, Chrome 105
  • Operating System: Linux, Windows, MacOS
Relevant logs:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named in the issue. Start by locating the failed-login blocking and timeout handling in the server authentication code, then reproduce the two-attempt, one-minute-lockout scenario. Done means failed-attempt counts for both the IP address and user reset after the configured blocking period.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.