Skip to content
Info disclosure Disclosed report Beginner CVE-2021-22892

Hi! Security Team Rocket.Chat, It's possible to get information about the users emails without authentication

The unauthenticated two-factor email code endpoint returned different responses depending on whether an account existed, so an attacker could confirm which email addresses or usernames were registered. This information could then feed brute-force, injection or social-engineering attempts.

khekhe Follow

Originally disclosed on HackerOne

  • Triaged in 31 days
  • Fixed in 58 days
  • Disclosed after 3 months

Description: Email enumeration vulnerability. Vulnerable api method: /api/v1/users.2fa.sendEmailCode

##Releases Affected::

  • Rocket.Chat up to 3.10.5

Request for existing account:

POST /api/v1/users.2fa.sendEmailCode HTTP/1.1
Host: rocket-chat.local:3000
Referer: http://rocket-chat.local:3000/home
Connection: close
Content-Length: 36
Content-Type: application/json;charset=UTF-8

{"emailOrUsername":"[email protected]"}

Response

HTTP/1.1 200 OK
X-XSS-Protection: 1
X-Content-Type-Options: nosniff
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 7
X-RateLimit-Reset: 1611804788737
content-type: application/json
Content-Length: 16

{"success":true}

Request for non-existent account:

POST /api/v1/users.2fa.sendEmailCode HTTP/1.1
Host: rocket-chat.local:3000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0
Accept: */*
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: http://rocket-chat.local:3000/home
Connection: close
Content-Length: 37
Content-Type: application/json;charset=UTF-8

{"emailOrUsername":"[email protected]"}

Response

HTTP/1.1 400 Bad Request
X-XSS-Protection: 1
X-Content-Type-Options: nosniff
X-Frame-Options: sameorigin
Pragma: no-cache
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 9
X-RateLimit-Reset: 1611805550459
Content-Length: 94

{"success":false,"error":"Invalid user [error-invalid-user]","errorType":"error-invalid-user"}

Suggested mitigation

  • Use general messages when a user exists in the system and when user doesn't exist in the system.

Impact

Information disclosure which opens new attack vectors - helpful for injections/brute-force attacks/social-engineering etc.

The original report as published on HackerOne, by khekhe. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the endpoint returned a distinct error for unknown users instead of a generic response, letting the reply reveal whether the account existed.

Impact

An unauthenticated attacker could determine which email addresses or usernames are registered, which the report says could help injections, brute-force attacks and social engineering.

What the attacker needed

No authentication needed; network access to the API

The fix

The endpoint should return the same generic message whether or not the user exists.

How it was found

  1. Send an unauthenticated request to the 2FA email code endpoint with an existing email or username.
  2. Observe a successful response.
  3. Send the same request with a non-existent email or username.
  4. Observe an error response indicating an invalid user, confirming the difference.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A site can leak whether an email is registered. Here an endpoint anyone could call without logging in did the same. Sending one address and seeing success versus an 'invalid user' error tells an attacker which addresses have accounts, useful for targeting people later.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from Rocket.Chat

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.