$3000 Bug Bounty Award from Mozilla for a successful targeted Credential Hunt
Published on embracethered.com
Last month I did some research on Firefox, specifically I was learning more about it’s remote debugging features. As part of that I was reading Bugzilla bug information and learned more about Mozilla’s infrastructure.
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
Mozilla runs a bug bounty programme and states publicly that it strongly supports security research into its products and wants to encourage that research. While learning about Firefox's remote debugging features and reading Bugzilla bug information, I picked up details about Mozilla's infrastructure. One of those details was that Mozilla uses Phabricator.
Phabricator is a collaborative web-based toolset covering code reviews, checkins, bugs, work items, wiki, pastes, credentials and many other things. As far as I know it was originally developed by Facebook.
The relevant feature here is Phabricator's API tokens. From past red teaming experience, it is common for developers to create API tokens for command line usage so they can interact with Phabricator. A tool called arcanist performs checkins via arc land and similar commands, and those tokens usually start with api- or cli- followed by a number of random characters.
Setup
No accounts, roles or special tooling were needed beyond the public information above. The preconditions were:
- Knowledge that Mozilla uses Phabricator.
- Knowledge of the token format used by arcanist (
api-orcli-prefixes). - A way to search public code, here GitHub repositories, for strings matching that format.
- The Phabricator
whoamiAPI to validate anything found.
The activity itself is what I call Credential Hunting: a dedicated and targeted activity that I recommend during red teaming and penetration testing. After gaining some basic intel about the systems in use and what to look for specifically, targeted credential hunting can be fruitful.
Finding it
Equipped with the intel about Phabricator and its token format, and knowing that Mozilla encourages security research, I decided to perform a targeted Phabricator Credential Hunt for Mozilla.
Using the information and techniques from my earlier post on Credential Hunting and related ones described in my book, I identified a valid Mozilla Phabricator API token, along with a Bugzilla token, in a GitHub repo. The tokens were found in a GitHub repo.
Exploitation
Step 1: Validate the token with the whoami API
To validate the token, I used the Phabricator whoami API:
curl https://<phabricator>/api/user.whoami -d api.[redacted]
The request posts the token as the api.token parameter to the user.whoami API method. The response showed that the token impersonated a Mozilla account. At that point I knew what I needed to know, and there was no need to perform any other action.
Root cause
A Phabricator API token belonging to a Mozilla account, together with a Bugzilla token, was found in a GitHub repo. The report does not describe how the tokens came to be in the repository, only that they were there.
Impact
The Phabricator token impersonated a Mozilla account, so possession of it would let an attacker act as that account against Mozilla's Phabricator. I did not exercise any further capability: validation through whoami was enough, and no other action was performed. The report does not enumerate what the specific account was authorised to do.
Fix
I promptly reported the issue to Mozilla and they fixed it basically immediately. They also performed investigations to ensure no misuse had occurred and searched for variants. Mozilla awarded a $3000 bug bounty reward for this. It was impressive to watch Mozilla's professionalism during the response.
Variants to test
This case is an argument for performing active and targeted credential hunts for your clients or organisation. Tokens often are out there, but automated scanning tools might not be able to identify or validate them yet, because of parsing, lack of intel, or other reasons. Concrete things to try:
- Search public repositories for the target's tooling token prefixes. For Phabricator, look for strings starting with
api-orcli-. A positive result is a candidate token in a repository tied to the target's organisation or developers. - Validate candidates against the tool's identity endpoint. For Phabricator, post the candidate to
user.whoamias shown above. A positive result is a response identifying a real account on the target's instance. - Hunt for secondary tokens in the same repository. In this case a Bugzilla token sat alongside the Phabricator one. A positive result is any additional credential for another service used by the same organisation.
- Repeat the hunt for other collaboration and code review platforms the target is known to use, using each platform's own token format and identity API. A positive result is the same: a token that validates against the target's instance.
References

What happened, in plain words
A security researcher found a working password-like key for one of Mozilla's internal tools in a GitHub repo. Mozilla makes Firefox and runs a lot of the software behind it. The key belonged to a tool called Phabricator, which Mozilla's developers use to review code and track work. A second key for Mozilla's bug tracker, Bugzilla, was in the same place. The researcher checked that the Phabricator key really worked, reported it, and Mozilla fixed the problem almost straight away. Mozilla paid a $3000 bug bounty for the finding.
This article walks through how that happened, step by step, and explains every term along the way. You only need to be comfortable using a browser.
Background: what the researcher was reading
Mozilla runs a bug bounty programme. A bug bounty programme is a public offer: if you find a security problem in our systems and tell us about it responsibly, we may pay you a reward. Mozilla states publicly that it strongly supports security research into its products and wants to encourage that research.
The researcher was learning about Firefox's remote debugging features. Remote debugging is a way to control and inspect a running browser from another program, usually on the developer's own machine. While reading Bugzilla bug information, which is Mozilla's public bug tracker, the researcher picked up details about Mozilla's infrastructure. Infrastructure here means the collection of servers and web tools a company uses internally to get work done.
One of those details was that Mozilla uses Phabricator.
What is Phabricator?
Phabricator is a collaborative web-based toolset. In plain terms, it is a website that a software team uses to do many jobs in one place: code reviews (reading a colleague's proposed code changes before they are accepted), checkins (saving code changes into the shared project), bugs, work items, a wiki (shared documentation pages), pastes (shared snippets of text), credentials and many other things. As far as the researcher knows, it was originally developed by Facebook.
The feature that matters here is Phabricator's API tokens.
What is an API, and what is an API token?
An API (Application Programming Interface) is a way for one program to talk to another over the internet, without a human clicking buttons. Think of a restaurant: the menu and the waiter are the API. You do not walk into the kitchen yourself; you ask through the waiter, in a fixed format, and food comes back. A website's API works the same way: a program sends a request in an agreed format and gets an answer back.
An API token is a long random string that acts like a password for a program. When a program calls an API, it sends the token along so the server knows who is asking. Think of a hotel key card: it is not your name and it is not a password you type, it is a small object that proves you are allowed in. Anyone who holds the card can get in, which is exactly why tokens must be kept secret.
From past red teaming experience, the researcher knows it is common for developers to create API tokens for command line usage so they can interact with Phabricator. Red teaming is the practice of attacking your own organisation on purpose, the way a real attacker would, to find weaknesses before someone else does. Command line means typing commands as text instead of clicking in a browser.
A tool called arcanist performs checkins via arc land and similar commands. Those tokens usually start with api- or cli- followed by a number of random characters. That prefix is a useful clue: it is like knowing that a certain brand of key always has a coloured plastic head, so you can spot one in a drawer full of keys.
Setup: what was needed before starting
No accounts, roles or special tooling were needed beyond the public information above. The preconditions were:
- Knowledge that Mozilla uses Phabricator.
- Knowledge of the token format used by arcanist (
api-orcli-prefixes). - A way to search public code, here GitHub repositories, for strings matching that format.
- The Phabricator
whoamiAPI to validate anything found.
A repository (repo) is a folder of code with its full history, hosted on a service such as GitHub. Many repositories are public, meaning anyone on the internet can read every file in them. A string is just a sequence of characters, like a word or a line of text.
The activity itself is what the researcher calls Credential Hunting: a dedicated and targeted activity recommended during red teaming and penetration testing. Penetration testing is a paid, authorised version of the same idea as red teaming: you are hired to break in, on paper, so the client can fix things. Credentials is the general word for anything that proves identity: passwords, tokens, keys. After gaining some basic intel about the systems in use and what to look for specifically, targeted credential hunting can be fruitful. The word targeted matters: instead of scanning everything blindly, you first learn what the target uses, then look for exactly that shape of secret.
Finding it
Equipped with the intel about Phabricator and its token format, and knowing that Mozilla encourages security research, the researcher decided to perform a targeted Phabricator Credential Hunt for Mozilla.
Using the information and techniques from an earlier post on Credential Hunting and related ones described in the researcher's book, a valid Mozilla Phabricator API token was identified, along with a Bugzilla token, in a GitHub repo. The tokens were found in a GitHub repo. Source code is the text developers write; it is stored in files in the repository, and if the repository is public, so are the files.
This is the heart of the problem: a secret that is written into a file and pushed to a public repository is no longer secret. It is like taping your house key to the outside of your front door because it is convenient to grab on the way out.
Exploitation
Step 1: Validate the token with the whoami API
Finding a string that looks like a token is not proof that it works. It could be an old token that was already cancelled, a fake example in documentation, or a token for a different system. So the next step is to check it. To validate the token, the researcher used the Phabricator whoami API:
curl https://<phabricator>/api/user.whoami -d api.[redacted]
Line by line, in plain words:
curlis a command line program that sends web requests. It is the same kind of request your browser sends when you open a page, just typed out instead of clicked.https://<phabricator>/api/user.whoamiis the address being called.<phabricator>is a placeholder for the real hostname of Mozilla's Phabricator server; the real name is not shown here./api/user.whoamiis the API method being called.whoamiis a common name for a method that answers the question "who am I?", that is, which account does this credential belong to.-d api.[redacted] tells curl to send a piece of data along with the request. The data is a parameter namedapi.tokenwhose value is the token itself.api-xxxx` stands in for the real token, which is not reproduced here.
The request posts the token as the api.token parameter to the user.whoami API method. The response showed that the token impersonated a Mozilla account. Impersonated means the server treated whoever held the token as that account, exactly as if that person had logged in. At that point the researcher knew what needed to be known, and there was no need to perform any other action. This restraint is deliberate and important: the goal was to prove the problem existed, not to use the account.
Root cause
A Phabricator API token belonging to a Mozilla account, together with a Bugzilla token, was found in a GitHub repo. Committed is the word for saving a change into a repository's history; once committed and pushed to a public repo, the content is visible to anyone and stays in the history even if it is deleted later. How the tokens came to be in the repository is not described in the report, only that they were there.
Impact
The Phabricator token impersonated a Mozilla account, so possession of it would let an attacker act as that account against Mozilla's Phabricator. Impact means what harm could actually be done if someone with bad intentions found the same thing. No further capability was exercised: validation through whoami was enough, and no other action was performed. What the specific account was authorised to do is not enumerated in the report.
Fix
The issue was promptly reported to Mozilla and they fixed it basically immediately. They also performed investigations to ensure no misuse had occurred and searched for variants. Variants here means other places where the same kind of secret might have leaked. Mozilla awarded a $3000 bug bounty reward for this. It was impressive to watch Mozilla's professionalism during the response.
Variants to test
This case is an argument for performing active and targeted credential hunts for your clients or organisation. Tokens often are out there, but automated scanning tools might not be able to identify or validate them yet, because of parsing, lack of intel, or other reasons. Parsing means a program reading text and picking out the parts it cares about; if it does not know the exact shape of a token, it may skip right over it. Concrete things to try:
- Search public repositories for the target's tooling token prefixes. For Phabricator, look for strings starting with
api-orcli-. A positive result is a candidate token in a repository tied to the target's organisation or developers. - Validate candidates against the tool's identity endpoint. For Phabricator, post the candidate to
user.whoamias shown above. A positive result is a response identifying a real account on the target's instance. An endpoint is simply a specific address on a server that accepts a particular kind of request. - Hunt for secondary tokens in the same repository. In this case a Bugzilla token sat alongside the Phabricator one. A positive result is any additional credential for another service used by the same organisation.
- Repeat the hunt for other collaboration and code review platforms the target is known to use, using each platform's own token format and identity API. A positive result is the same: a token that validates against the target's instance.
References

Glossary
- API: a way for one program to talk to another over the internet in an agreed format, like a menu and waiter between you and the kitchen.
- API token: a long random string that acts as a password for a program, proving which account is making a request.
- Arcanist: a command line tool used to perform checkins to Phabricator; its tokens usually start with
api-orcli-. - Bug bounty: a public offer by a company to pay a reward for responsibly reported security problems.
- Bugzilla: Mozilla's bug tracking system.
- Checkin: saving a code change into a shared project.
- Command line: typing commands as text instead of clicking in a browser.
- Commit: saving a change into a repository's history.
- Credential: anything that proves identity, such as a password, token or key.
- Credential hunting: a targeted search for credentials that have leaked into places anyone can read.
- curl: a command line program that sends web requests.
- Endpoint: a specific address on a server that accepts a particular kind of request.
- GitHub: a website that hosts code repositories, many of them public.
- Impact: the harm that could result if a weakness were used by an attacker.
- Impersonate: to be treated by a server as a particular account, as if that person had logged in.
- Infrastructure: the servers and web tools a company uses internally.
- Parsing: a program reading text and picking out the parts it cares about.
- Penetration testing: authorised, paid attempts to break into a system so the owner can fix weaknesses.
- Phabricator: a collaborative web toolset for code reviews, checkins, bugs, work items, wiki, pastes and credentials.
- Red teaming: attacking your own organisation on purpose, the way a real attacker would, to find weaknesses first.
- Remote debugging: controlling and inspecting a running browser from another program.
- Repository: a folder of code with its full history, often hosted publicly.
- Source code: the text developers write, stored in files in a repository.
- String: a sequence of characters, such as a word or a line of text.
- Variant: another place where the same kind of secret or weakness might appear.
- whoami: a common API method name that answers which account a credential belongs to.