Skip to content
Access control Disclosed report Beginner

Team admin can change unauthorized team setting (allow_message_deletion)

A team admin could change the 'allow_message_deletion' team setting, which should only be modifiable by a team owner. An attacker with admin privileges could enable message deletion for all users, bypassing the intended restriction.

satishb3 Follow

Originally disclosed on HackerOne

Bounty$100 View original
  • Triaged in 9 hours
  • Fixed in 6 days
  • Paid in 6 days
  • Disclosed after 4 months

Team admin can escalate his privileges and change 'allow_message_deletion' team setting, which can be changed only by a team owner.

Steps to reproduce:

  1. Log in as team admin.
  2. Send the below request using his cookie & token and notice that it changes 'allow_message_deletion' team setting to true.

POST /api/team.prefs.set?t=1423146704 HTTP/1.1 Host: teamname.slack.com User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:34.0) Gecko/20100101 Firefox/34.0 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Referer: https://teamname.slack.com/admin/settings Cookie: _ga=GA1.2.630936366.1423056192; a-3204538285=..

prefs=%7B%22msg_edit_window_mins%22%3A%221%22%2C%22allow_message_deletion%22%3Atrue%7D&token=xoxs-xxxx&set_active=true&_attempts=1

To confirm, login as team owner. Navigate to /admin/settings#permissions, expand message editing & deletion section. Notice that 'Only administrators may delete messages' checkbox is checked.

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

Slack teams have a set of administrative settings that control how members can behave. One of them, allow_message_deletion, governs whether ordinary members are allowed to delete messages. In the Slack admin UI this setting appears under /admin/settings#permissions, in the message editing and deletion section, as the checkbox "Only administrators may delete messages". The report treats this setting as one that only a team owner may change.

The target is the Slack web API endpoint team.prefs.set, which writes team-level preferences. The researcher found that a team admin, a role below owner, could call this endpoint and change allow_message_deletion even though the setting is meant to be owner-only.

Setup

  • A Slack team with at least two roles in play: a team admin account and a team owner account.
  • The admin's session cookie and API token, used to send the request.
  • A browser session as the owner to confirm the resulting state in the admin UI.
  • The request was sent against teamname.slack.com, with the admin settings page as the referer.

No special tooling is described beyond sending a crafted HTTP request with the admin's own credentials.

Finding it

The researcher sent a prefs object containing allow_message_deletion to team.prefs.set with a team admin's credentials, and the setting was changed to true. Since the UI presents this option as owner-controlled, an admin being able to flip it through the API is a privilege escalation: the server was not enforcing the owner-only restriction on this particular preference.

Exploitation

Step 1: Log in as team admin

Authenticate to the team as an admin. This gives a session cookie and a token that the next request will use.

Step 2: Send the crafted request

The admin sends the following request with their own cookie and token:

HTTP
POST /api/team.prefs.set?t=1423146704 HTTP/1.1
Host: teamname.slack.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:34.0) Gecko/20100101 Firefox/34.0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: https://teamname.slack.com/admin/settings
Cookie: _ga=GA1.2.630936366.1423056192; a-3204538285=..

prefs=%7B%22msg_edit_window_mins%22%3A%221%22%2C%22allow_message_deletion%22%3Atrue%7D&[redacted]&set_active=true&_attempts=1

What the important parts do:

  • POST /api/team.prefs.set is the endpoint that writes team preferences. The t query parameter is included in the request.

  • Host: teamname.slack.com targets the specific team.

  • Referer: https://teamname.slack.com/admin/settings is the admin settings page.

  • Cookie carries the admin's cookies, including _ga and a-3204538285.

  • The body is form-encoded. prefs is a URL-encoded JSON object:

    It sets msg_edit_window_mins to "1" and sets allow_message_deletion to true.

  • `[redacted] is included in the body.

  • set_active=true and _attempts=1 are also in the body.

The researcher notes that the request changes the allow_message_deletion team setting to true.

Step 3: Confirm as owner

Log in as the team owner, navigate to /admin/settings#permissions, and expand the message editing and deletion section. The "Only administrators may delete messages" checkbox is checked, confirming that the admin's request took effect.

Root cause

The team.prefs.set endpoint accepts a prefs object and applies the supplied keys, including allow_message_deletion, without checking that the caller holds the owner role required for that specific setting. The per-setting owner restriction is not enforced server-side. The API does not enforce the owner-only restriction, so a direct request bypasses it. The report does not describe the server-side code, so the exact location of the missing check is likely in the preference handler rather than in the endpoint's general access control.

Impact

A team admin can escalate their privileges for this setting and change allow_message_deletion, which the report states can be changed only by a team owner. In practice this lets an admin change the team's message deletion policy. The report does not describe further consequences beyond the setting change itself.

Fix

Variants to test

  1. Send other owner-only preferences through team.prefs.set as an admin and check whether they are accepted. A positive result is the setting changing when confirmed as owner.
  2. Try the same prefs payload with a lower-privileged role (for example a regular member) to see whether the endpoint's general authorisation is also weak. A positive result is the request succeeding and the setting changing.
  3. Remove or alter the Referer header and resend. A positive result is the request still being accepted, showing the referer is not the control.
  4. Send the same request with set_active omitted or changed. A positive result is the preference still being written, showing the parameter is not a meaningful guard.

Hunting notes

This kind of bug tends to hide in endpoints that accept a bulk preference object (prefs as JSON) and apply keys generically. The UI may restrict which options a role can see, but the API often does not repeat that restriction per key. During recon, look for admin settings pages that render different controls for different roles, then capture the underlying write requests and replay them with a lower role's credentials. Signals include a single endpoint handling many settings, a JSON blob in a form field, and role-dependent UI that is not reflected in the request. The researcher showed the change from the admin's request and then confirmed it in the owner's UI.

Difficulty

{"difficulty": "beginner", "difficulty_reason": "The bug is found by replaying a normal admin settings request with a lower role and observing that a per-setting owner restriction is not enforced server-side."}

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

Slack is a chat tool that companies use to talk internally. Every Slack workspace (Slack calls it a "team") has people with different levels of power. A team owner is at the top: they decide the rules. A team admin is one step below: they help run the team but are not supposed to be able to change owner-only rules.

One of those rules is called allow_message_deletion. It controls whether ordinary members are allowed to delete their messages. In the Slack admin screens it appears as a checkbox labelled "Only administrators may delete messages". According to the report, only a team owner should be able to change this setting.

The researcher found that a team admin could still change it. By sending a request directly to the server that runs Slack. The server accepted the request and changed the setting anyway. This is a privilege escalation: someone with a lower level of power manages to do something reserved for a higher level.

Background ideas you need first

Before the steps make sense, here are a few everyday ideas.

  • A web page versus the server behind it. When you tick a checkbox in a browser, the page does not change anything by itself. It sends a message to a computer somewhere else, called the server, and the server does the real work. The page is just the shop window; the server is the warehouse.
  • An API. An API (Application Programming Interface) is the set of doors on the server that programs (and web pages) use to ask it to do things. Each door has an address, called an endpoint. Here the endpoint is team.prefs.set, which means "set the team's preferences". Think of it as a service counter labelled "change team settings".
  • A request. A request is the message your browser sends to the server. It has a method (the verb, such as POST, meaning "send this data and change something"), a path (which counter you are at), some headers (extra labels describing the message) and often a body (the data itself).
  • A cookie. A cookie is a small piece of text your browser stores for a website and sends back with every request. It usually identifies your logged-in session, like a wristband at an event that proves you already showed your ticket. If someone has your cookie, the server thinks they are you.
  • A token. A token is a second kind of pass, a long string of characters that also proves who you are. The report shows a token with the real value replaced by xxxx. The report shows one with the real value replaced by xxxx.
  • URL encoding. Some characters are not allowed in a request body, so they are written in a coded form. %7B means {, %22 means a double quote, %3A means a colon, and so on. It is the same text, just written in a safe alphabet.
  • JSON. JSON is a simple way of writing structured data as text, using curly braces, names in quotes, and values. {"name": true} means "the thing called name is switched on".
  • The Referer header. Despite the spelling, this header tells the server which page the request came from. Servers sometimes use it to check that a request really started from their own site.

The setup

To reproduce the bug you need:

  1. A Slack team with at least two accounts: one team admin and one team owner.
  2. The admin's session cookie and API token, so you can send requests as that admin.
  3. A browser logged in as the owner, to look at the settings page afterwards and confirm what changed.

The request is aimed at teamname.slack.com, which is a placeholder for the real team's address, and it pretends to come from the admin settings page.

No special hacking tools are needed. The researcher simply sent a hand-written request using the admin's own credentials.

Finding it

The researcher noticed two things. First, the team.prefs.set endpoint accepts a bundle of settings called prefs, and that bundle can contain allow_message_deletion. Second, when a team admin sent that bundle, the server accepted it and set the value to true.

The normal web page presents this option as something only an owner controls. So if an admin can flip it through the API, the server is not enforcing the owner-only rule on this particular setting. The page hides the button, but the warehouse door is still open.

Exploitation

Step 1: Log in as team admin

Sign in to the team as the admin. This gives you a session cookie and a token, which the next request will carry. The reason for this step is simple: the request must look like it comes from a real, logged-in admin, because that is the role whose power we are testing.

Step 2: Send the crafted request

The admin sends the following request using their own cookie and token:

HTTP
POST /api/team.prefs.set?t=1423146704 HTTP/1.1
Host: teamname.slack.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:34.0) Gecko/20100101 Firefox/34.0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: https://teamname.slack.com/admin/settings
Cookie: _ga=GA1.2.630936366.1423056192; a-3204538285=..

prefs=%7B%22msg_edit_window_mins%22%3A%221%22%2C%22allow_message_deletion%22%3Atrue%7D&[redacted]&set_active=true&_attempts=1

Line by line, in plain words:

  • POST /api/team.prefs.set?t=1423146704 HTTP/1.1 is the first line. POST is the verb meaning "change something". /api/team.prefs.set is the endpoint, the counter for team preferences. ?t=1423146704 is a query parameter added to the address. HTTP/1.1 is the version of the language being spoken.
  • Host: teamname.slack.com says which team's server this is for. Slack hosts many teams, so the server needs to know which one.
  • User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:34.0) Gecko/20100101 Firefox/34.0 says which browser sent the request. Here it claims to be Firefox on a Mac.
  • Content-Type: application/x-www-form-urlencoded; charset=UTF-8 says how the body is formatted: as a list of name equals value pairs, the same format a normal web form uses.
  • Referer: https://teamname.slack.com/admin/settings says the request came from the admin settings page. It says the request came from the admin settings page.
  • Cookie: _ga=GA1.2.630936366.1423056192; a-3204538285=.. carries the admin's session. The cookies include _ga and a-3204538285. The value after the equals sign is shortened in the report. This is the wristband that proves the sender is logged in as the admin.
  • The blank line separates the headers from the body.
  • The body is prefs=%7B%22msg_edit_window_mins%22%3A%221%22%2C%22allow_message_deletion%22%3Atrue%7D&[redacted]&set_active=true&_attempts=1. It has four parts joined by &:
    • prefs=... is the bundle of settings, URL-encoded. Decoded, it is the JSON below.
    • `[redacted] is included in the body.
    • set_active=true is also in the body.
    • _attempts=1 is also in the body.

The prefs value, once decoded, is this JSON object:

It sets two things. msg_edit_window_mins is set to "1". allow_message_deletion is set to true, which is the important one. The researcher notes that sending this request changes the allow_message_deletion team setting to true.

By writing the request by hand, the researcher skips the page and talks to the server directly, which is the whole point of the test.

Step 3: Confirm as owner

Now log in as the team owner, go to /admin/settings#permissions, and expand the message editing and deletion section. The checkbox "Only administrators may delete messages" is ticked. That confirms the admin's request actually took effect on the server, not just in the admin's own browser.

Checking as the owner matters because the owner is the role that is supposed to control this setting. Seeing the change in the owner's view is the proof that the rule was broken.

Root cause

The team.prefs.set endpoint takes the prefs object and applies whatever keys are inside it, including allow_message_deletion, without checking that the caller is an owner, which is the role required for that specific setting. The per-setting owner rule is not enforced on the server. The API does not enforce the owner-only restriction, so a direct request goes around it.

The report does not describe the server-side code, so the exact place where the check is missing is not shown. The likely spot is the code that handles preferences, rather than the endpoint's general access control.

Impact

A team admin can raise their own power for this setting and change allow_message_deletion, which the report says only a team owner may change. In practice, an admin can alter the team's message deletion policy. The report does not describe any further consequences beyond the setting change itself.

Fix

Variants to test

  1. Send other owner-only preferences through team.prefs.set as an admin and see whether they are accepted. A positive result is the setting changing when you confirm as owner.
  2. Try the same prefs payload with a lower role, such as a regular member, to see whether the endpoint's general access control is also weak. A positive result is the request succeeding and the setting changing.
  3. Remove or change the Referer header and resend. A positive result is the request still being accepted, which shows the referer is not the control.
  4. Send the same request with set_active left out or changed. A positive result is the preference still being written, which shows that parameter is not a meaningful guard.

Hunting notes

This kind of bug tends to hide in endpoints that accept a bundle of preferences (a prefs JSON object) and apply the keys generically. The page may limit which options a role can see, but the API often does not repeat that limit for each key. When looking around, find admin settings pages that show different controls to different roles, then capture the requests those pages send and replay them with a lower role's credentials. Signs to look for include one endpoint handling many settings, a JSON blob inside a form field, and role-dependent pages whose restrictions are not reflected in the request. The researcher showed impact by making the change from the admin's request and then confirming it in the owner's page.

Difficulty

This is a beginner-level bug. It is found by replaying a normal admin settings request with a lower role and noticing that a per-setting owner restriction is not enforced on the server.

Glossary

  • API: the set of doors a server offers so that programs and web pages can ask it to do things.
  • Endpoint: one specific address on a server, such as team.prefs.set, that performs one job.
  • Request: the message a browser or program sends to a server, with a method, a path, headers and often a body.
  • Method (verb): the word at the start of a request, such as POST, saying what kind of action is wanted.
  • Header: an extra label on a request, such as Host or Referer, giving the server more information.
  • Body: the data part of a request, sent after the headers.
  • Cookie: a small piece of text a browser stores for a site and sends back with each request, usually proving you are logged in.
  • Session: the state of being logged in, kept alive by a cookie or token.
  • Token: a long string of characters that acts as a pass proving who you are; Slack tokens start with xoxs-.
  • URL encoding: writing special characters in a safe coded form, for example %7B for {.
  • JSON: a text format for structured data using curly braces, quoted names and values.
  • Referer header: a header saying which page the request came from.
  • User-Agent header: a header saying which browser and system sent the request.
  • Content-Type header: a header saying how the body is formatted.
  • Team owner: the top role in a Slack team, who decides the rules.
  • Team admin: a role below owner that helps run the team but should not change owner-only rules.
  • Privilege escalation: when someone with a lower level of power manages to do something reserved for a higher level.
  • allow_message_deletion: the Slack team setting controlling whether ordinary members may delete messages.
  • team.prefs.set: the Slack API endpoint that writes team preferences.
  • prefs: the bundle of settings sent to that endpoint, written as JSON.
  • Root cause: the underlying reason a bug exists, here a missing role check on the server.
  • Server-side check: a rule enforced by the server itself, which cannot be bypassed by editing the page.
  • Replay: sending a captured request again, possibly with different credentials, to see how the server reacts.

More by satishb3

View all

12 more disclosed reports, best first.

More from Slack

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.