Skip to content
Crypto Disclosed report Intermediate CVE-2022-32227

Rocket.chat user info security issue

A user with the 'view-full-other-user-info' permission could retrieve another user's OAuth access and refresh tokens through the users.info REST API endpoint. This could allow an attacker to use those tokens to access other systems that rely on the same identity provider.

mikolajczak Follow

Originally disclosed on HackerOne

Medium 5.0 View original
  • Triaged in 5 days
  • Fixed in 4 months
  • Disclosed after 6 months

Summary by the program

Hello, We have find potential security issue that user with “view-full-other-user-info” permissions is able to view another user's OAuth tokens via Rest API.

Tested on Rocket.Chat version 4.3.3

Steps to reproduce:

  1. Integration with OAuth 2.0 identity provider (e.g. Keycloak) is required
  2. Add role with permissions “view-full-other-user-info” to user1
  3. Log in to Rocket.Chat as user1
  4. Go to My Account -> Personal Access Tokens -> Add, save Token and UserId
  5. Call Rocket API using curl, provide username of another Rocket.chat user who also is using OAuth:

curl -H "X-Auth-Token: <token>" -H "X-User-Id: <userId>" https://domain.com/api/v1/users.info?username=<user2>

In result you get all info includes tokens:

{ "user": { "_id": "xyz", "createdAt": "2019-09-20T12:46:18.874Z", "services": { "keycloak": { "_OAuthCustom": true, "accessToken": "xyz", "idToken": "xyz", "expiresAt": 1646996798596, "refreshToken": "xyz", "sub": "xyz", "email_verified": false, "name": "user2", "preferred_username": "user2", "given_name": "user2", "family_name": "user2", "email": "[email protected]", "id": "xyz", "username": "user2", "serverURL": "https://idp.url" } }, ...

This is a critical security issue. Users must not be able to view another user's tokens issued by identity provider. Even user with administrator role must not be able to do that. Capturing OAuth access and refresh tokens may lead to unauthorized access to other systems using the same identity provider.

Impact

Take control on oAuth tokens another users.

Fix

Fixed in versions 4.7.5, 4.8.2, 5.0.0

The original report as published on HackerOne, by mikolajczak. 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 users.info API endpoint returned the full user document, including sensitive OAuth token fields, without filtering them out for users who had the view-full-other-user-info permission.

Impact

An attacker with the view-full-other-user-info permission could obtain another user's OAuth access and refresh tokens, potentially gaining unauthorised access to other systems that use the same identity provider.

What the attacker needed

OAuth 2.0 identity provider integration; Attacker has view-full-other-user-info permission; Victim uses the same OAuth provider

The fix

The issue was fixed in versions 4.7.5, 4.8.2, and 5.0.0.

How it was found

  1. Set up an OAuth 2.0 identity provider integration, such as Keycloak.
  2. Give user1 a role that includes the view-full-other-user-info permission.
  3. Log in as user1 and create a personal access token, saving the token and user ID.
  4. Use curl to call the users.info API with user1's token and user ID, specifying user2's username.
  5. Observe that the response includes user2's OAuth tokens.

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.

Some applications let you log in through another service, like a company login system. When you do, that service gives the app special codes called tokens that prove who you are. This report found that a user with a certain permission could see other people's tokens, which could let them pretend to be those people on other websites.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More from Rocket.Chat

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.