How I snooped into your private Slack messages [Slack Bug bounty worth $2,500]
Slack's email integration used per-team subdomains (like teamname.slack.com) whose MX records pointed to a third-party email service where those subdomains were unclaimed. An attacker could claim a team's subdomain, intercept emails sent to the integration address, and read or modify private messages before they reached the channel.
Published on web.archive.org
When researching about MX records of slack.com, I noticed that they used a 3rd party email service. In that service, however slack.com was already claimed.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Slack lets a team live on a subdomain of the form teamname.slack.com. One of the integrations offered to teams is the Email app, which turns an email address into a way of posting a message into a Slack channel: you send mail to the address and the message appears in the channel. The report describes this app as available only on the Standard plan and above, so the researcher upgraded his own workspace to Standard to study it.
The researcher's starting point was not the app itself but DNS. While looking at the MX records of slack.com, he noticed that Slack used a third party email service, and that slack.com was already claimed in that service. He then found that every team subdomain, such as teamname.slack.com, also had its MX records pointed at the same service, and that these team domains were not claimed. Mail addressed to those domains could therefore be intercepted by whoever claimed them first.
Setup
- A Slack workspace owned by the researcher, on the Standard plan, so that the Email app could be installed.
- The Email app installed on a channel of that workspace.
- Access to the third party email service that Slack's MX records pointed to, enough to claim a domain and configure routing.
- No special tooling is described beyond DNS lookups and the email service's own configuration.
Finding it
The observation that drove the research was a mismatch between who owns a domain in DNS and who owns it at the mail provider. Slack's MX records delegated mail for slack.com and for each teamname.slack.com to a third party service. At that service, slack.com was claimed, but the per team subdomains were not. An unclaimed domain at a mail provider can normally be claimed by anyone with an account there, after which that person controls where its mail is delivered.
The researcher then asked what Slack actually did with mail sent to those domains. On the HackerOne page for Slack he found the Email app described as a way to send a message to a channel through email. That made the unclaimed subdomains interesting: if a team's channel address lives on a domain whose mail can be redirected, the mail can be read before it reaches Slack.
Exploitation
Step 1: Install the Email app and obtain a channel address
After installing the Email app on his channel, the researcher was given an address of the form:
[hashedtext]@uraniumsecteam.slack.com
The local part is a randomly generated hash. The report explains the reason: without it, the address could be enumerated and used to spam the channel. The domain part is the team's own teamname.slack.com subdomain, which is the same domain whose MX records the researcher had already seen pointing at the third party service.
Step 2: Claim the team subdomain at the mail provider
The researcher set the routing in the email service so that all mail arriving at @uraniumsecteam.slack.com was delivered to his own inbox. From that point, any message sent to the channel address was received by him rather than by Slack.
Step 3: The general attack against another team
The report describes the scenario for a victim team, which it calls team X, with the domain x.slack.com. Team X uses the default Email app and has been given a private address such as:
[redacted]
An intruder claims x.slack.com through the same email service and sets the route to a personal address such as:
[redacted]
Once that is done, when team members send a message to [redacted], the message does not reach the channel. The intruder receives it instead, and can then choose to forward it to the team, modify it, or edit it before it arrives.
Root cause
The design relied on the secrecy of the hashed local part to protect the channel address, but the domain part of that address was a team subdomain whose MX records delegated mail handling to a third party service where the subdomain had never been claimed. The hash prevents enumeration and spam, but it does nothing once an attacker controls delivery for the whole domain: every address at that domain, hashed or not, is routed wherever the claimer points it. The existing defence, a random local part, therefore did not address the actual weakness, which was unclaimed mail domains under slack.com.
Impact
An attacker who claims a team's subdomain at the mail provider can read messages that team members send to the channel's email address. Because the attacker sits in the delivery path, they can also forward the message to the team unchanged, modify it, or edit it. The researcher notes that the issue allowed him to read messages of any team, and it was escalated to tier 0, critical, once it was reported. The attack requires the victim team to use the Email app and the attacker to claim the team's subdomain before anyone else does.
Fix
Slack applied a quick fix first: even if the domain was claimed, incoming email to it would still be rejected. A permanent fix was then deployed. It still allows the domain to be claimed, but mail now goes through the app and reaches the channel instead of reaching the attacker's mailbox.
- Enumerate MX records for every subdomain a SaaS product hands to customers (per tenant, per region, per brand) and check whether each domain is claimed at the mail provider it points to. A positive result is a tenant domain whose MX target accepts a claim from your account.
- Look for inbound email features that generate addresses on tenant subdomains, such as channel, ticket or comment by email. A positive result is an address whose domain matches an unclaimed MX domain you can take over.
- Check whether the provider validates domain ownership before accepting mail for it, for example with a TXT record or a verification email to a known mailbox. A positive result is a provider that lets you claim and route a domain with no proof of control.
- After claiming, send a test message to the generated address and confirm where it lands. A positive result is the message arriving in your inbox rather than in the product.
- Test whether the product rejects mail for claimed domains after the fact, which is the shape of Slack's quick fix, and whether the permanent behaviour routes mail to the intended destination regardless of who claimed the domain.
What happened, in plain words
Slack is a chat product: a company signs up, gets a workspace, and its people talk in channels. Each workspace lives on its own web address of the form teamname.slack.com, so a company called Acme would use acme.slack.com. Slack also offers an integration called the Email app. It gives a channel an email address, and anything sent to that address is posted into the channel as a message. That is handy if you want a monitoring system, a form or a colleague to drop a note into a channel without opening Slack.
The researcher, Rojan Rijal, started from something much less glamorous: the records that tell the internet where to deliver a domain's email. Those records are called MX records. He noticed that Slack did not run its own mail servers for slack.com; it pointed mail at a third party email service. At that service, slack.com had already been claimed by Slack. But every team subdomain, such as teamname.slack.com, also pointed its mail at the same service, and those team subdomains had not been claimed by anyone.
That gap is the whole bug. If a mail provider lets anyone claim a domain that nobody has claimed yet, then whoever claims teamname.slack.com there decides where mail for that domain goes. And because the Email app gives channels addresses on exactly that domain, the claimer can read messages meant for the channel before Slack ever sees them. The researcher proved it on his own workspace, and the report says the issue was escalated to tier 0, critical once it was reported.
The starting point: DNS and MX records
Every domain name has a set of records attached to it, kept in a worldwide directory called DNS. Think of DNS as a phone book: you look up a name and get back an address. One kind of record, the MX record, answers a narrower question: which mail server should receive email for this name? When you send mail to [redacted], your mail software looks up the MX record for example.com and hands the message to whatever server that record names.
A company does not have to run that server itself. It can point its MX record at a mail provider, a company whose business is receiving and filtering mail. The provider then needs to know which customer owns which domain, so the customer claims the domain in the provider's control panel. Once claimed, the provider accepts mail for it and delivers it wherever the customer configured.
This is where the researcher began. Looking at the MX records of slack.com, he saw that Slack used a third party email service, and that slack.com was already claimed there. He then looked at the team subdomains, names like teamname.slack.com, and found that they too had their MX records pointed at the same service. Unlike slack.com, these team domains were not claimed. Mail for them could therefore be intercepted by whoever claimed them first.
Why does that matter? The researcher asked himself two questions: could you send a message to your team from an email, and what happens if someone else controls that email? Those questions led to the deeper research described below.
Finding out what Slack did with those addresses
Before going further, the researcher needed to know whether Slack actually used email in a way that touched these domains. While browsing the HackerOne page for Slack, he found the Email app described as a way to send a message to a channel through email. That was the link he needed: if a channel's email address sits on a domain whose mail can be redirected, then the mail can be read before it reaches Slack.
The report notes that this app was only available on the Standard plan and above. To study it properly, the researcher upgraded his own workspace to Standard and installed the app.
Setting up
The setup was small, and the report lists no special tools beyond DNS lookups and the email service's own configuration:
- A Slack workspace owned by the researcher, on the Standard plan, so the Email app could be installed.
- The Email app installed on a channel of that workspace.
- Access to the third party email service that Slack's MX records pointed to, enough to claim a domain and set up routing.
Step 1: Install the Email app and get a channel address
After installing the Email app on his channel, the researcher was given an address of this form:
[hashedtext]@uraniumsecteam.slack.com
Reading it piece by piece: everything before the @ is the local part, the part that identifies a mailbox at a domain. Here it is a randomly generated hash, a string of characters produced by a one way function so that it cannot be guessed. Everything after the @ is the domain, and here it is the team's own subdomain, uraniumsecteam.slack.com, the same domain whose MX records the researcher had already seen pointing at the third party service.
The report explains why the local part is random: without it, the address could be enumerated, meaning someone could try likely addresses one after another until they found a working one, and then use it to spam the channel. A random hash makes guessing impractical.
Step 2: Claim the team subdomain at the mail provider
The researcher then set the routing in the email service so that all mail arriving at @uraniumsecteam.slack.com was delivered to his own inbox. From that moment, any message sent to the channel address was received by him rather than by Slack.
This is the heart of the trick. The random hash protects the address from being guessed, but it says nothing about who controls the domain. Once you control delivery for the whole domain, every address at that domain, hashed or not, is routed wherever you point it. The secrecy of the local part becomes irrelevant.
Step 3: The same attack against another team
The report then describes the scenario for a victim team, which it calls team X, with the domain x.slack.com. Team X uses the default Email app and has been given a private address such as:
[redacted]
Again, hashedtext is the random local part and x.slack.com is the team's subdomain. An intruder claims x.slack.com through the same email service and sets the route to a personal address such as:
[redacted]
Here hacker is the intruder's mailbox name and intruder.com is a domain the intruder controls. Once that route is in place, when team members send a message to [redacted], the message does not reach the channel. The intruder receives it instead. Because the intruder sits in the delivery path, they can then choose to forward the message to the team unchanged, modify it, or edit it before it arrives.
Why it worked
The design relied on the secrecy of the hashed local part to protect the channel address. But the domain part of that address was a team subdomain whose MX records handed mail handling to a third party service where the subdomain had never been claimed. The hash prevents enumeration and spam, but it does nothing once an attacker controls delivery for the whole domain. The existing defence, a random local part, therefore did not address the actual weakness, which was unclaimed mail domains under slack.com.
What an attacker could do
An attacker who claims a team's subdomain at the mail provider can read messages that team members send to the channel's email address. Because the attacker sits in the delivery path, they can also forward the message to the team unchanged, modify it, or edit it. The researcher notes that the issue allowed him to read messages of any team, and it was escalated to tier 0, critical once it was reported. The attack requires the victim team to use the Email app and the attacker to claim the team's subdomain before anyone else does.
How Slack fixed it
Slack applied a quick fix first: even if the domain was claimed, incoming email to it would still be rejected. A permanent fix was then deployed. It still allows the domain to be claimed, but mail now goes through the app and reaches the channel instead of reaching the attacker's mailbox.
Each one is a question you can ask about a service that hands out subdomains to its customers.
- Enumerate MX records for every subdomain a SaaS product hands to customers (per tenant, per region, per brand) and check whether each domain is claimed at the mail provider it points to. A positive result is a tenant domain whose MX target accepts a claim from your account.
- Look for inbound email features that generate addresses on tenant subdomains, such as channel, ticket or comment by email. A positive result is an address whose domain matches an unclaimed MX domain you can take over.
- Check whether the provider validates domain ownership before accepting mail for it, for example with a TXT record or a verification email to a known mailbox. A positive result is a provider that lets you claim and route a domain with no proof of control.
- After claiming, send a test message to the generated address and confirm where it lands. A positive result is the message arriving in your inbox rather than in the product.
- Test whether the product rejects mail for claimed domains after the fact, which is the shape of Slack's quick fix, and whether the permanent behaviour routes mail to the intended destination regardless of who claimed the domain.
Glossary
- DNS: the internet's directory of names, which turns a domain name into the records and addresses attached to it.
- MX record: a DNS record that says which mail server should receive email for a domain.
- Subdomain: a name built under a larger domain, such as
teamname.slack.comunderslack.com. - Mail provider: a company that receives and delivers email on behalf of others, so customers do not run their own mail servers.
- Claiming a domain: registering a domain at a mail provider so that the provider accepts mail for it and delivers it where the customer says.
- Routing: the rule that decides which mailbox receives mail for a domain.
- Email app: Slack's integration that gives a channel an email address and posts anything sent to it into the channel.
- Local part: the part of an email address before the
@, which identifies a mailbox at a domain. - Hash: a string produced by a one way function, so that the original input cannot easily be recovered and the output cannot be guessed.
- Enumeration: trying likely values one after another to find a working one, such as guessing channel email addresses.
- Spam: unwanted bulk messages sent to an address.
- Interception: reading a message in transit, before it reaches its intended recipient.
- Tier 0: the highest severity level in a bug bounty programme, used for critical issues.
- Bug bounty: a programme that pays researchers for reporting security problems responsibly.
- SaaS: software sold as a service, run by the vendor and used by customers over the internet.
- Tenant: one customer's isolated space inside a shared service, such as one company's Slack workspace.
- TXT record: a DNS record that can hold arbitrary text, often used to prove you control a domain.
- Root cause: the underlying design or configuration mistake that makes a vulnerability possible, as opposed to its symptoms.