[FIX] User Impersonation through sendMessage API#20391
Merged
sampaiodiego merged 10 commits intodevelopfrom Apr 30, 2021
Merged
[FIX] User Impersonation through sendMessage API#20391sampaiodiego merged 10 commits intodevelopfrom
sampaiodiego merged 10 commits intodevelopfrom
Conversation
…ge-impersonate' permission
|
This pull request introduces 1 alert when merging 940e5a7 into 3901dce - view on LGTM.com new alerts:
|
sampaiodiego
approved these changes
Apr 30, 2021
Merged
|
I don't like this change, because you actually see the real user handle after the set alias. And this change is not properly documented - the exact RocketChat version number for this BREAKING change (it is not even mentioned that this is a breaking change) is missing here: https://developer.rocket.chat/api/rest-api/endpoints/chat/sendmessage#important in the changelog. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes (including videos or screenshots)
Create a new permission:
message-impersonate. For new installs only bot role will have the permission and for updating installs the permission will also be given to user role, so it won't break running deployments.If a message is being sent with
avataroraliasproperties, it validates if the sender has themessage-impersonatepermission, if not, an error is throwed:{ "success": false, "error": "Not enough permission", "stack": "Error: Not enough permission\n ..." }Issue(s)
Steps to test or reproduce
Further comments
The Meteor call
sendMessageallows usage of custom avatar and alias, which in combination allows impersonation of other chat room members. That way, spoofed message senders can potentially be used in social engineering attacks.With the
message-impersonatepermission, that problem can be solved.