RocketChat / RocketChat/Rocket.Chat
API for post message work whithout permission
Open
@gabrieleiro is already working on this.
Since Nov 12, 2020.
area: backend
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
All LDAP users can use the API and postMessage with all aliases and avatars. Same if the user has no permissions.
Steps to reproduce:
- Take a ldap user with or without permissions
- authenticate your user with the API
- Use the API with your informations:
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq"
-H "X-User-Id: aobEdbYhXfu5hkeqG"
-H "Content-type:application/json"
http://localhost:3000/api/v1/chat.postMessage
-d '{ "channel": "#general", "alias": "ANYBODY", "avatar": "ALLAVATARS", "text": "This is a test!" }'
Expected behavior:
An error because just user with role 'bot' can do it according to the documentation.
Actual behavior:
The message is send and the it's possible to anybody to usurp an identity
Server Setup Information:
- Version of Rocket.Chat Server: 3.2.2
- Operating System: Ubuntu server 18.04
- Deployment Method: Docker
- Number of Running Instances: 1
- MongoDB Version: 4.2
Client Setup Information
- Desktop App or Browser Version: API
Additional context
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.
Assessment
This issue has not been assessed yet.