RocketChat / RocketChat/Rocket.Chat
users.createToken does not respect OTP required for admin Personal Access Tokens
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
If I call the api 'users.createToken' with headers={"X-User-Id": admUserId, "X-Auth-Token": some_personal_access_token_with_otp_required} , json= {"username": userToDisable}) , the access token for the user is created BUT it shouldn't. The call should fail because my personal access token requires OTP.
Steps to reproduce:
- Create a personal access token for some admin user and set OTP as required ( default )
- Try to create a token for another user using the admin personal token
- the operation will be sucessful
Expected behavior:
It should fail due missing OTP.
Actual behavior:
The token for the user will be created.
Server Setup Information:
- Version of Rocket.Chat Server: 3.11
- Operating System: k8s
- Deployment Method: k8s
- Number of Running Instances: 1
- DB Replicaset Oplog:
- NodeJS Version:
- MongoDB Version: 4.0.20
Client Setup Information
- Desktop App or Browser Version: N/A
Additional context
Relevant logs:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the users.createToken API entry point and reproduce the request with an admin personal access token that requires OTP. Done means the operation rejects the request when OTP is missing instead of creating the other user's token.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, authentication, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100