Skip to content
Access control Disclosed report Intermediate

Member role which doesn't have permission to send message can send by executing channel commands

A user with only member-level permissions could post messages to a channel they were not allowed to write to by invoking a slash command through the command execution endpoint. The endpoint did not check whether the caller had permission to post in the target channel before delivering the command output there.

ramsakal7582 Follow

Originally disclosed on HackerOne

Medium 4.3 View original
  • Triaged in 46 hours
  • Fixed in 4 months
  • Paid in 8 days
  • Disclosed after 15 months

Summary:

Someone with a member permission who hasn't been given access to post message to the channel can post it by executing commands.

Steps To Reproduce:

POST /api/v4/commands/execute HTTP/1.1
Host: test3.cloud.mattermost.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0
Accept: */*
Accept-Language: en
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
X-CSRF-Token:5 [ jkue786iyfd6dkpiq7ftisys6y
Content-Type: application/json
Content-Length: 104
Origin: https://test3.cloud.mattermost.com
Connection: close
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin

{"command":"/echo ami","channel_id":"khhnkrf5wf8yibwx8bd14s6fbw","team_id":"8jdphis493d4pbq3u1bagz643r"}
  • Executing above command will post the message to the given channelID and TeamID when you try to reproduce it with your cookie.

Impact

Someone who doesn't have permission to post message to the channel can still post it by executing channel commands.

The original report as published on HackerOne, by ramsakal7582. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 command execution endpoint checked that the user could run commands but did not verify that the user had permission to post in the specified channel before posting the command output there.

What the attacker needed

A member account; a channel where posting is restricted; a valid session and CSRF token

The fix

The command execution endpoint should check that the caller may post in the target channel before posting command output there.

How it was found

  1. Send a command execution request to the API with a valid session and CSRF token.
  2. Include a channel identifier and team identifier for a channel where the user cannot normally post.
  3. Observe that the command output is posted into that channel anyway.

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.

In chat apps, some channels are read-only for certain people: they can read but not write. This report shows that a person could still get a message into such a channel by using a built-in command (a slash command) instead of typing normally, because the command feature did not check the same permission. The result is that a restriction the app claims to enforce could be bypassed.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from Mattermost

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.