Complete authentication bypass to admin permissions
A NoSQL injection flaw in Rocket.Chat let an unauthenticated attacker bypass authentication by supplying a MongoDB operator as the access_token query parameter, matching the first OAuth token in the database. This allowed account takeover without valid credentials, provided at least one OAuth token existed.
- Disclosed after 2 months
Summary by the program
A NoSQL injection vulnerability in Rocket.Chat allows unauthenticated remote attackers to bypass authentication and perform account takeover. By passing a MongoDB operator as the access_token query parameter (e.g., ?access_token[$ne]=null), an attacker can match the first OAuth token in the database without supplying valid credentials. Exploitation requires at least one OAuth token to exist in the database. Affected versions: <8.3.0, <8.2.1, <8.1.2, <8.0.3, <7.13.5, <7.12.6, <7.11.6, and <7.10.9.
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 application passed the access_token query parameter directly into a MongoDB query without sanitising it, allowing query operators to alter the lookup.
Impact
An unauthenticated attacker could bypass authentication and take over an account, but only if at least one OAuth token already existed in the database.
What the attacker needed
At least one OAuth token in database; no authentication needed
The fix
The text lists affected versions below 8.3.0, 8.2.1, 8.1.2, 8.0.3, 7.13.5, 7.12.6, 7.11.6 and 7.10.9; it does not state a fix.
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.
Rocket.Chat is a chat application. It checked a login token by putting user input straight into a database query, so an attacker could send a special database instruction instead of a real token and the database would return the first token it found. That let the attacker log in as whoever owned that token.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.