Skip to content
Leaked secrets Disclosed report Beginner

Mozilla Mastodon Staging Instance Admin API Key Disclosure Through Slack

An admin API token for a Mozilla Mastodon staging instance was accidentally posted in a Slack channel. Anyone with access to that channel could use the token to perform administrative actions on the Mastodon server.

griffinf Follow

Originally disclosed on HackerOne

Bounty$1,000incl. $500 bonus High View original
  • Triaged in 11 hours
  • Fixed in 3 days
  • Paid in 6 days
  • Disclosed after 6 days

Summary:

I was able to find Admin Maston API Keys disclosed within Mozilla's #trust-and-safety-eng channel which was posted by a staff member of Mozilla.

Steps To Reproduce:

  1. Authenticate to mozilla.slack.com as an NDA or Mozillla Staff Member (https://wiki.mozilla.org/NDA)
  2. Search the #trust-and-safety-eng channel for █████████ (Exposed token)
  3. Validate that the token through the following command:

tok=███ ep=https://stage.moztodon.nonprod.webservices.mozgcp.net curl -H "Authorization: Bearer $tok" "$ep/api/v1/admin/accounts/"

  1. Observe the following output (I've redacted some as it shows the output of all Mastodon accounts):

████████

  1. Please note that this was only one API call demonstrated. Maston has the ability to create new accounts, change passwords. delete accounts and delete tweets as referenced within their API documentation here with the Admin API tokens - https://docs.joinmastodon.org/methods/accounts/

Supporting Material/References:

Please find attached the conversation where the API token was accidentaly leaked.

██████████

Impact

Summary:

The exposure of Admin Mastodon API tokens represents a critical security vulnerability with the potential for severe consequences. These tokens grant unauthorized individuals comprehensive access to the Mastodon server, allowing them to manipulate user data, spread malicious content, and compromise the integrity of the platform. Immediate action is required to mitigate this risk and protect both the system and its users.

The original report as published on HackerOne, by griffinf. 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

Mozilla runs a staging Mastodon instance for its non-production environment. The report names the host as stage.moztodon.nonprod.webservices.mozgcp.net. Mastodon is a federated social network server; its admin API exposes account management functions, and access to those functions is controlled by admin API tokens sent as bearer credentials.

The bug is not in the Mastodon code. It is a secret-handling failure: an admin API token for that staging instance was posted in a Mozilla Slack channel, #trust-and-safety-eng, by a member of Mozilla staff. The researcher found it by searching Slack and then used it against the staging API.

The report is filed under Mozilla's HackerOne programme, weakness "Insecure Storage of Sensitive Information", severity high, with a bounty of 1000.00 USD, disclosed on 2023-09-11.

Setup

The precondition is access to Mozilla's Slack workspace, mozilla.slack.com, as either an NDA holder or a Mozilla staff member. The report links the NDA wiki page (https://wiki.mozilla.org/NDA) as the reference for that access level. No other tooling is required beyond a shell with curl and the ability to search Slack channels.

The target of the token is the staging Mastodon instance at https://stage.moztodon.nonprod.webservices.mozgcp.net. The instance is a staging environment, so the data behind it is not production data.

Finding it

The researcher searched the #trust-and-safety-eng channel and found an admin Mastodon API key that had been posted there by a staff member. The report describes the leak as accidental and attaches the conversation where the token was disclosed.

Once a bearer token is in a channel, anyone who can read that channel and search it can retrieve it later, long after the message scrolled out of view. That is the exposure the researcher acted on.

Exploitation

Step 1: authenticate to Slack

Authenticate to mozilla.slack.com with an NDA or Mozilla staff account. This is the only access control in front of the leaked token.

Step 2: search the channel

Search the #trust-and-safety-eng channel for the exposed token. The report redacts the search string, so the exact term is not public.

Step 3: validate the token against the admin API

The researcher validated the token with a single request against the staging instance:

Bash
tok=███
ep=https://stage.moztodon.nonprod.webservices.mozgcp.net
curl -H "Authorization: Bearer $tok" "$ep/api/v1/admin/accounts/"

tok holds the leaked admin token and ep holds the staging base URL. The request calls the admin accounts collection endpoint with the token as a bearer credential. A successful response confirms the token is live and carries admin rights on that instance.

Step 4: read the response

The output listed all Mastodon accounts on the instance. The researcher redacted most of it in the report for that reason. The fact that the endpoint returned account data at all is the proof: an unauthenticated or non-admin caller would not get that listing.

Step 5: note the wider API surface

The researcher demonstrated only one API call. The report points out that the same admin token class can create new accounts, change passwords, delete accounts and delete posts, citing the Mastodon admin API documentation at https://docs.joinmastodon.org/methods/accounts/. Those capabilities were not exercised; they follow from the documented behaviour of admin tokens.

Root cause

The token was stored in plain text in a Slack channel message, where it persisted and remained searchable by every member with access to that channel. There is no indication in the report of token rotation, scoping or expiry that would have limited the damage once the message was posted. The admin API accepted the token as-is.

Impact

The report describes the exposure as severe: an admin Mastodon API token gives unauthorised individuals comprehensive access to the Mastodon server. With it, an attacker could manipulate user data, spread malicious content and compromise the integrity of the platform. The demonstrated impact is read access to the full account listing; the documented impact extends to account creation, password changes, account deletion and post deletion through the admin API.

The condition is that the attacker has Slack access at the NDA or staff level.

Fix

The report does not state what remediation was applied. The obvious measures are to revoke and reissue the leaked token, purge the message from the channel, and avoid pasting admin credentials into Slack.

Variants to test

  1. Search engineering and operations Slack channels for strings that look like bearer tokens, API keys and connection strings. A positive result is a message containing a credential that still authenticates against a live endpoint.
  2. Test whether leaked tokens have been rotated by replaying them after the leak window. A positive result is a token that still returns data.
  3. Check whether lower-privilege workspace members can read channels where credentials are shared. A positive result is a non-admin account retrieving a working token.
  4. Look for tokens in attached files and pasted logs, not just message text. A positive result is a credential inside an attachment that the search index still surfaces.

Hunting notes

This class of bug hides in collaboration tools: Slack, chat, ticketing systems, wikis and pastebins, especially channels tied to engineering, trust and safety, and incident response. The signal during recon is access to a workspace where staff discuss infrastructure, combined with search over historical messages for token-shaped strings and hostnames of internal or staging services.

The researcher validated the token with one authenticated request that returned account data, then pointed to the documented admin capabilities the same token unlocks. That combination, a live credential plus a demonstrated privileged response plus a documented blast radius, is what makes a leaked-secret report actionable for the programme.

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. 9 min read.

What happened, in plain words

Mozilla runs a social network server called Mastodon. Mastodon is server software for running a social network where people post short messages and follow each other. Mozilla had one of these servers set up for testing, not for real users. The report calls this a "staging" instance, which means a practice copy of a system, used to try things out before they go live.

To manage a Mastodon server, an administrator uses something called an API. An API is a way for one computer program to talk to another over the internet, like a waiter taking your order to the kitchen and bringing back your food. You send a request, the server sends back a response. The Mastodon admin API is the set of requests that let an administrator manage accounts: create them, change passwords, delete them, and so on.

To prove you are allowed to make those requests, you send a token. A token is a long string of random-looking characters that works like a temporary key or a wristband at an event: if you have it, the door opens, and the server does not ask who you are beyond that. The report calls these "admin API tokens" and says they are sent as "bearer credentials", which just means the token is carried along with each request, like showing the wristband at every door.

The problem was not a bug in the Mastodon software. It was a secret-handling mistake. Someone at Mozilla posted one of these admin tokens in a Slack channel called #trust-and-safety-eng. Slack is a workplace chat tool, and channels are group conversations inside it. The researcher found the token by searching that channel, then used it against the testing server to show it still worked.

The report was filed through Mozilla's HackerOne programme. HackerOne is a platform where security researchers report bugs to companies and can receive a reward, called a bounty. The report is classed as weakness "Insecure Storage of Sensitive Information", which means a secret was kept somewhere it should not have been. It was rated high severity, carried a bounty of 1000.00 USD, and was disclosed on 2023-09-11.

Setting the scene

The testing Mastodon server lives at the address stage.moztodon.nonprod.webservices.mozgcp.net. The word "stage" and the "nonprod" in the middle both signal that this is not the real, live service.

To find the token in the first place, you need access to Mozilla's Slack workspace at mozilla.slack.com. The report says this access must be either as an NDA holder or as a Mozilla staff member. An NDA is a non-disclosure agreement, a signed promise not to share confidential information; the report links the wiki page https://wiki.mozilla.org/NDA as the reference for that access level. Beyond a shell (a text window where you type commands) with the curl tool and the ability to search Slack, nothing else is needed. curl is a small command-line program for sending web requests, the same kind your browser sends when you load a page, but typed instead of clicked.

Finding it

The researcher searched the #trust-and-safety-eng channel and found an admin Mastodon API key that a staff member had posted there. The report describes the leak as accidental and attaches the conversation where the token was disclosed.

Once a token is in a channel, anyone who can read that channel and search it can retrieve it later, long after the message has scrolled out of view. That is the exposure the researcher acted on.

Exploitation

Step 1: sign in to Slack

Authenticate to mozilla.slack.com with an NDA or Mozilla staff account. This is the only access control standing in front of the leaked token. In other words, the token itself is not protected by anything except the fact that you have to be inside the workspace to see the message.

Step 2: search the channel

Search the #trust-and-safety-eng channel for the exposed token. The report redacts the search string, so the exact term is not public. The reason for this step is simple: the message may be old and buried, but Slack keeps an index of past messages, so a search can bring it back.

Step 3: check the token against the admin API

The researcher validated the token with a single request against the testing server:

Bash
tok=███
ep=https://stage.moztodon.nonprod.webservices.mozgcp.net
curl -H "Authorization: Bearer $tok" "$ep/api/v1/admin/accounts/"

Line by line:

  1. tok=███ stores the leaked admin token in a variable called tok. A variable is a named box that holds a value so you can reuse it without retyping it. The actual value is redacted here.
  2. ep=https://stage.moztodon.nonprod.webservices.mozgcp.net stores the base address of the testing server in a variable called ep (short for endpoint, meaning the address you send requests to).
  3. curl -H "Authorization: Bearer $tok" "$ep/api/v1/admin/accounts/" sends a web request. curl is the tool doing the sending. -H adds a header, which is extra information attached to a request, like a note on an envelope. The header here is Authorization: Bearer $tok, which tells the server "the person making this request is carrying this token". $tok means "put the contents of the tok box here". The address being requested is the base address plus /api/v1/admin/accounts/, which is the admin endpoint that lists accounts. If the server answers with data, the token is live and has admin rights on that instance.

Step 4: read the response

The output listed all Mastodon accounts on the instance. The researcher redacted most of it in the report for that reason. The fact that the endpoint returned account data at all is the proof: someone without a valid admin token would not get that listing. Think of it as asking a receptionist for the full guest list and being handed it without any further questions.

Step 5: note the wider API surface

The researcher demonstrated only one API call. The report points out that the same kind of admin token can also create new accounts, change passwords, delete accounts and delete posts, citing the Mastodon admin API documentation at https://docs.joinmastodon.org/methods/accounts/. Those capabilities were not actually exercised; they follow from what the documentation says admin tokens are allowed to do. This matters because it shows the damage is not limited to reading a list.

Why it happened

The token was stored in plain text in a Slack message, where it stayed and remained searchable by every member with access to that channel. The report gives no indication of token rotation, scoping or expiry that would have limited the damage once the message was posted. Rotation means replacing a token with a new one and cancelling the old; scoping means limiting what a token is allowed to do; expiry means a token that stops working after a set time. None of these appear to have been in place.

The admin API accepted the token as-is.

Impact

The report describes the exposure as severe: an admin Mastodon API token gives unauthorised people comprehensive access to the Mastodon server. With it, an attacker could manipulate user data, spread malicious content and compromise the integrity of the platform. The demonstrated impact is read access to the full account listing; the documented impact extends to account creation, password changes, account deletion and post deletion through the admin API.

The condition is that the attacker has Slack access at the NDA or staff level.

Fix

The report does not state what remediation was applied. The obvious measures are to revoke and reissue the leaked token, purge the message from the channel, and avoid pasting admin credentials into Slack. Revoking means cancelling the token so it no longer works.

Variants to test

  1. Search engineering and operations Slack channels for strings that look like bearer tokens, API keys and connection strings. A positive result is a message containing a credential that still authenticates against a live endpoint.
  2. Test whether leaked tokens have been rotated by replaying them after the leak window. A positive result is a token that still returns data.
  3. Check whether lower-privilege workspace members can read channels where credentials are shared. A positive result is a non-admin account retrieving a working token.
  4. Look for tokens in attached files and pasted logs, not just message text. A positive result is a credential inside an attachment that the search index still surfaces.

Hunting notes

This class of bug hides in collaboration tools: Slack, chat, ticketing systems, wikis and pastebins, especially channels tied to engineering, trust and safety, and incident response. The signal during recon is access to a workspace where staff discuss infrastructure, combined with search over historical messages for token-shaped strings and hostnames of internal or testing services. Recon here means the early looking-around phase before any attack is attempted.

The researcher validated the token with one authenticated request that returned account data, then pointed to the documented admin capabilities the same token unlocks. That combination, a live credential plus a demonstrated privileged response plus a documented blast radius, is what makes a leaked-secret report actionable for the programme. Blast radius means how much damage could be done if the secret falls into the wrong hands.

Glossary

  • API: a way for one computer program to talk to another over the internet, sending requests and receiving responses.
  • Admin API: the part of an API that lets an administrator manage a system, such as creating or deleting accounts.
  • Bearer credential: a token sent with each request that proves access simply by being carried, like a wristband at an event.
  • Bounty: a reward paid by a company to a researcher who reports a security problem.
  • Channel: a group conversation inside a chat tool such as Slack.
  • curl: a command-line tool for sending web requests.
  • Endpoint: the address you send a request to.
  • Expiry: a set time after which a token stops working.
  • HackerOne: a platform where researchers report bugs to companies and can receive rewards.
  • Header: extra information attached to a web request, like a note on an envelope.
  • Instance: one running copy of a piece of software, here a Mastodon server.
  • Mastodon: software for running your own social network server.
  • NDA: a non-disclosure agreement, a signed promise not to share confidential information.
  • Recon: the early looking-around phase before any attack is attempted.
  • Revoke: cancel a token so it no longer works.
  • Rotation: replacing a token with a new one and cancelling the old.
  • Scoping: limiting what a token is allowed to do.
  • Severity: a rating of how serious a security problem is.
  • Shell: a text window where you type commands.
  • Slack: a workplace chat tool with channels and searchable message history.
  • Staging: a practice copy of a system, used to try things out before they go live.
  • Token: a long string of characters that works like a key, proving you are allowed to make a request.
  • Variable: a named box in a shell that holds a value so you can reuse it.
  • Vulnerability class: a category of security problem, here "Insecure Storage of Sensitive Information", meaning a secret was kept somewhere it should not have been.

More by griffinf

View all

14 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.