Breaking Slack

Table of Contents

1. Preface

Communication is a tricky problem, because it's hard to make everyone happy. When internet messaging started out, we had lots of choices, due to the existence of standards that allowed multiple servers to talk to each other (XMPP federation) and standards that allowed a single client to talk to multiple servers (IRC). In recent years, we have backtracked away from that model in favor of hundreds of closed protocols, forcing users to install yet another client for every service they use (hangouts, messenger, signal, telegram, groupme, whatsapp, skype, tox, SMS, …). This means that if you love a particular chat app, you simply won't be able to use it everywhere!

1.1. Slack

Slack is a particularly bad example of the above, since it's a tool 'targeted' towards team communication, rather than just direct messages. Usually, a team consists of many more people than the average chat, and that makes the above even more relevant, since the more people you need to connect, the more flexibility you must have to keep the team happy and running smoothly. Slack disallows features that even IRC has had for decades, such as ignoring, blocking, message filtering, and knocking, which makes it a terrible tool for any team that is actually trying to get things done. Unfortunately, I have been forced into using slack in a few places that I 'work' at, which will hopefully no longer be necessary in the long term.

However, Slack goes even further by also being terribly designed under the hood, making it extremely easy to 'break'. While these are 'not security problems', they do cause serious problems to team communication, and are impossible for moderators to fix without slack admins intervening.

I do have code for most of these 'exploits', but I will not be linking to them directly to make them 'harder to use'. They are somewhere in my GitLab namespace though. I have not done anything with a TODO on my own, but it shouldn't be too hard.

TL;DR: This is a guide to making your fellow slack user's lives as painful as possible, ideally while staying anonymous.

2. Message Limits

Message limits are the first core problem of slack. Since most slack users use a web client, and don't store any messages locally, 'clearing' the message history causes a bunch of problems.

Slack message limits are shared across dms, mpdms, public channels, and private channels. Slack message limits include both human and bot messages.

2.1. Message Bomb

Slack has very generous throttling rates, even for extended periods of time. It's incredibly easy to make a bot that keeps posting something in a private channel. Since bots and DM's count to the message limit, we can speed this up even more by getting a bot to do half our work!

slackbot.png

We can speed this up even more by exploiting other bot features, which I'll talk about later.

The message limit is 10,000 messages. Assuming we're posting at a very conservative one message per second, that lets us clear the message history in about 3 hours. With slackbot replying to all of our messages as well, that comes down to 1.5 hours. This is crazy for such a slow rate. At higher rates (or with multiple accounts), we can clear the message history in a matter of minutes or seconds, meaning that people won't be able to see any messages if they are more than a couple minutes old.

Deleting messages DOES NOT FREE UP HISTORY, so deleted history is GONE FOREVER. The only way to get a team's messages back is to pay slack support (or have them stored locally).

BONUS: Since we're clearing messages so quickly, DM's or other notifications that show up won't be able to be cleared with default settings in the ui. This means people will be stuck with unread notification markers they won't be able to clear without some extra effort!

3. Slack Namespace

Unlike any other self respecting (modern) chat application, it is impossible to create two channels with the same name. As if this isn't bad enough, this namespace is shared among users, public channels, private channels, and user groups.

It's impossible for moderators to see who's hoarding the channel namespace.

3.1. Channel Hoarding

This is especially effective when joining a new slack team. Simply by creating tons and tons of private channels with popular names such as leads, dev, and beta, we can make logical channel unavailable for public. Even better, make channels that conflict with users and user groups that could be made in the future.

Private channels are also very useful, since they are needed for many of the other 'exploits'. Private channel creation can be turned off by your moderator. However, moderators are unable to delete existing private slack channels, so hoard private channels early!

3.2. TODO Channel Creation Bot

It wouldn't be too hard to make a bot that creates private channels with every possible name. It probably would be a good idea to start with a wordlist, tailored to the team being targeted, to maximize the effect.

Another idea is to detect any username change from posts in #general (which you cannot leave), and create a private channel with the old username. This would prevent any user from re-using their old username.

4. Lack of Permissions

A lot of issues come up when mixing some of the more restrictive permissions options with 'unconventional' usage.

4.1. TODO Channel Jail Bot

For example, a common (but not default) setting is to restrict archiving channels. This means that when you create a private channel, you'll be unable to delete or even leave it until someone else joins (who in-turn will be jailed). The web UI does not make this clear at all though, and it confuses everyone who is jailed for their first time.

It wouldn't be too hard to detect when someone says something you don't like, create a private channel for them, add them to said channel, and leave said channel. This is a huge annoyance for the recipient, since it clutters their channel list and gives them an unneeded notification (which cannot be disabled by any means in the slack app). If they attempt to jail the bot itself, the bot could immediately leave the channel. Other than that, it guarantees that at least one member will be jailed, until a moderator is added.

Unfortunately, it's easy to see who's doing this in the logs, but there's no way an moderator can prevent this from happening besides banning private channels (stock up while you can), or by disabling your account.

If you combine this with the Message bomb method above, we can quickly clear our invite/part logs as well, which can hide your tracks to some extent.

5. Notification Spam

Notification spam is unfortunately hard to achieve without getting noticed, because notifications usually have the sender's name attached. There are ways to get around this though…

Since no one can leave #general, (and most slack moderators don't change settings about @everyone/@here/@channel), it is extremely easy to send the entire team a notification with a quick @channel/@everyone. If you delete the post immediately after that, the only thing linking you to the notification is direct eyewitnesses or the notification popup itself.

6. Bots

Bots let you take some of the burden off of your own infrastructure, and make breaking slack easier than ever for everyone!

6.1. PlusPlus

PlusPlus is a very popular extension for slack, and is installed on many teams. However, it's very easy to exploit PlusPlus for evil, as PlusPlus is installed on a team, rather than on a channel (like IRC), it's trivially easy to exploit, as the leaderboards of plusplus show.

First of all, we can trigger plusplus in a couple ways:

  • @username++
  • username+++
  • @anything++

I found that if one method of voting did not work in my automation, a different one would work, so I was able to trigger plusplus from anywhere (that isn't a 'true slack bot', as slack bots cannot talk to each other).

PlusPlus replies like this:

  • Woot! [@username++, now at # points]
  • Ouch! [@username--, now at # points]

This means that in addition to the notification you get when someone initially ++'s you, you get another one when the bot replies (which can improve the section above)!

You can pair this with @channel or @everyone to notify everyone on the team twice. If your team has the username: style of notification turned off, you can exploit this by sending a username+++, which will not trigger a notification on your message, but will trigger one in the reply.

A bot that posts a +++ style of plussing, and immediately deletes it's post will trigger a notification with no trace back to the bot, other than an eyewitness testimony.

PlusPlus has the ability to add/subtract multiple people at once, like so:

  • username+++ username2+++

Even better, it sends an individual message for every single one.

It's incredibly easy to build a file full of @1-- @2-- @3--..., post a single message, and delete your initial post. Once a wave like this starts, it can go on for a couple minutes before slack begins trottling PlusPlus. By the time this happens, PlusPlus will have posed about 1,000 messages, which means with a measly 10 messages, you can wipe an entire team's history.

6.2. SlackBot

Slackbot is the king of all bots in slack. Not only is it a bot (and therefore can easily be exploited), but it's got higher permissions than any other bot. That means it's able to trigger bots itself (although it does not respond to bots), as well as notify people. By exploiting slackbot, we can make our own automation more powerful than slack lets us do directly.

Slackbot has two 'killer' features we can take advantage of, slackbot responses and reminders. Slackbot responses are great because they're enabled by default (meaning they're enabled almost everywhere) and you can customize them to say whatever you want. Reminders are great because they let us effectively remove our own infrastructure when we want to host a bot, and let slack tear itself apart instead.

If for some reason, you find you can't access bots at all (ie: accessing slack over the client API), you can take advantage of slackbot to solve your problems by simply setting up a slackbot response to act like a proxy.

6.3. SlackBot and PlusPlus

If you have both slackbot and plusplus on your slack server, you can exploit them together for profit. Simply set up a reccuring reminder to @1-- @2-- @3--... every day or so, add plusplus, and watch the fireworks.

slack-spam.png

You don't ever need to log into slack again, people will loose their messages for 'unexplained reasons'.

7. Room For Improvement

7.1. Threads

Threads are incredibly buggy and I guarantee you can exploit them (to hide your messages, to cause notifications, etc), but I wasn't able to explore that in much detail before I left slack.

7.2. Evolution

As slack adds more misfeatures, it's likely these problems will get worse, not better.

Merge Requests are appreciated if you find a problem with this post, or a new slack exploit.

8. Conclusion

It's incredibly easy to break slack! But why?

It boils down to a couple points, which slack could easily fix to solve all these problems. These basic features have been requested many times, but slack seems to be ignoring these requests.

  1. Message/File Limits
  2. Lack of fine grained notification control
  3. Inability to block/ignore users
  4. Lack of chanop (+o)
  5. Inability of moderators to see secret channels

8.1. Mitigation

If you are a slack moderator, and you are concerned about these threats, you should immediately:

  1. Disallow user creation of all channels
  2. Disallow all bots
  3. Disallow deletion or editing of any messages
  4. Disallow any domain from automatically joining your slack channel (manual invites only)
  5. Disallow @everyone, @here, and @channel.
  6. Disallow setting slackbot replies, and delete any present replies
  7. Ensure you personally know everyone in your slack team, and are able to hold all of them accountable.

Even with these steps, there are risks (ie: posting in a DM to slackbot cannot be disabled, as slackbot cannot be disabled). If you would like a better solution you can:

  1. Pay slack for premium (which solves half of these issues)
  2. Switch to a better designed chat platform
    • Please pick something that your team can use, not something that uses your team.
    • IRC (still going strong)
    • XMPP (if you really want 'modern features')
    • Matrix (if you really really want 'modern features')

9. Navigation

Author: Jay Kamat

Published: 2017-06-24

Emacs 28.2 (Org mode 9.5.5)