Secret Key Exposure in API Config Directory
Published on ahmdhalabi.medium.com
My name is Ahmad Halabi, Founder & CTO at Cybit Sec and I am currently a part time bug bounty hunter mostly on Hackerone.
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
At the start of February 2021 I received an invitation to a private program specialising in Big Data and Integration services. The scope was limited to a single website that had a dashboard. I worked the dashboard first and found one valid bug there. While reviewing the traffic in Burp Suite I noticed that the dashboard talks to an API at the following base URL:
https://redacted.com/api
That API, and specifically the content and directories exposed under it, is what this write-up is about.
Setup
The work was done against the private program's dashboard site, using Burp Suite to inspect traffic and FFUF together with a customised wordlist to brute-force API content and directories. No special account or role is described beyond access to the dashboard itself. The only precondition that matters is that the API base path was reachable and that directory discovery against it was permitted by the program's scope.
Finding it
The first thing worth doing against an API is discovering its content and directories, so I ran FFUF with a wordlist I usually customise against the API path. That surfaced an interesting directory called config:
Checking its content showed a token named LoginUrlSecretKey, whose value looked something like:
S#@x%^&$!1 …
That value caught my attention. A key with a name like LoginUrlSecretKey sitting in a directory that directory brute-forcing can reach is exactly the kind of thing that should not be publicly readable.

The screenshot shows the response from the config endpoint with the LoginUrlSecretKey entry and its value visible.
Exploitation
Step 1: Discover the API base and its directories
I took the API base URL observed in Burp Suite and ran content discovery against it with FFUF and a customised wordlist. The result was the config directory at https://redacted.com/api/config, whose response contained the LoginUrlSecretKey token.
Step 2: Work out where the key is used
Having found what is probably a key used for API login, my main goal became finding where the token is used. I tried several methods and techniques to detect where the key is used, or to find any other useful information connected to it:
- I searched the target program's GitHub repositories for the secret key with GitHub search. No positive results were found.
- I used Google dorks to look for any information related to the secret token. Also negative.
- I checked Wayback URLs and JavaScript files. Also negative.
That left two possibilities:
- The secret key is a dummy key used for testing purposes.
- The key is truly secret, as its name suggests, because nothing related to it turned up in my recon.
I decided to report the issue on the basis of the second assumption.
Step 3: Report and defend the finding
The timeline of the report was as follows:
| Date | Event |
|---|---|
| Feb 4, 2021 | I sent the report describing the issue. |
| Feb 5, 2021 | HackerOne Triage closed the report as Informative, stating that an app "leaking" these secrets does not necessarily mean there is a security risk, and invited me to provide more details if I wanted the report reconsidered. |
| Feb 5, 2021 | I provided additional details about my recon process in determining why the key is secret, showing that I found no information related to it, based on my second assumption. |
| Feb 5, 2021 | HackerOne Triage forwarded the report to the internal team. |
| Feb 22, 2021 | The report was triaged by the HackerOne Triage Team. |
| Feb 26, 2021 | Severity was updated to High, a bounty of $800 was awarded, and the report was resolved with the fix confirmed. |
The turning point was not proving where the key could be used, because I could not, but flipping the argument: demonstrating through recon that nothing about the key exists publicly on the internet, which supports the conclusion that it is genuinely secret.
Root cause
The config directory under the API base was discoverable by directory brute-forcing and returned a configuration document containing a secret named LoginUrlSecretKey. In other words, configuration data intended for internal use was served from a publicly discoverable path. The report does not describe the server-side code or the mechanism by which the directory was exposed, so the precise implementation mistake is not stated.
Impact
A secret used for API login purposes was exposed to anyone who could reach the config path. The report does not demonstrate the key being used against any endpoint, and the researcher could not determine where the key is consumed. The impact therefore rests on the key being genuinely secret, which the recon supported by finding no public references to it. Under that assumption, an attacker who obtained the key could use it for the API login purpose its name implies. The report does not state which systems or data that would give access to.
Fix
Variants to test
- Run directory and content discovery against API base paths with a customised wordlist, looking for names such as
config,settings,envand similar. A positive result is a response containing configuration data, keys or tokens. - When a secret is found, search the program's GitHub repositories, Google dorks, Wayback URLs and JavaScript files for it. A positive result is any public reference that shows where the key is used; a consistently negative result supports the argument that the key is genuinely secret.
- If a report of an exposed secret is closed as Informative, resubmit with the recon evidence showing the key is not publicly referenced anywhere, framed as proof of secrecy rather than proof of exploitation.

What happened, in plain words
A security researcher was invited to test a private bug bounty program, which is a scheme where a company pays people to look for weaknesses in its systems and report them privately. The company in question works in Big Data and Integration services, which means it handles large amounts of data and connects different software systems together. The researcher was allowed to test only one website, and that website had a dashboard: a logged-in area where a user sees and manages things.
While using the dashboard, the researcher watched the network traffic between the browser and the website using a tool called Burp Suite. Burp Suite sits between your browser and the internet and records every request and response, so you can read exactly what is being sent and received. In that traffic, the researcher noticed the dashboard was talking to an API at a particular address. An API (Application Programming Interface) is the part of a website that software talks to directly, rather than the part a person clicks on. A useful everyday comparison: a restaurant has a dining room where customers sit (the dashboard you see) and a kitchen door where orders are passed through (the API). The kitchen door is not meant for customers, but if it is left open, anyone can walk through it.
The researcher then went looking for files and folders under that API address, the way you might try opening doors in a corridor to see which ones are unlocked. One of them, called config (short for configuration, meaning settings), was open. It contained a secret key, a long random-looking string used like a password by software. The key was named LoginUrlSecretKey, which strongly suggests it is used when logging in through the API.
The researcher could not work out where the key was actually used, so instead of proving the key could be abused, the researcher proved the opposite: that the key was genuinely secret, because it appeared nowhere on the public internet. The report was first closed as not a security issue, then reopened with that extra evidence, and eventually paid a bounty of 800 US dollars.
Background you need first
A few ideas come up again and again below, so here they are from zero.
Dashboard. A dashboard is the private, logged-in part of a website where you see your data and controls. Think of it as the staff area behind a shop counter.
API. An API is a set of addresses that software uses to exchange data. When your browser loads a dashboard, the dashboard's code often sends requests to the API behind the scenes to fetch numbers, lists or settings. You do not see these requests, but they are ordinary web requests, and a tool like Burp Suite can show them to you.
Endpoint and directory. An endpoint is one specific address on a server that does something, for example https://example.com/api/config. A directory is a folder-like part of a web address. In https://redacted.com/api/config, api and config look like folders. Servers do not always treat them as real folders, but the idea helps: you can try guessing folder names and see which ones answer.
Token or secret key. A token (also called a key or a secret) is a long string of characters that software uses to prove who it is, much like a password. The difference is that a person types a password, while a program sends a token automatically with each request. If someone else gets your token, they can pretend to be your program. That is why tokens must be kept private.
Information disclosure. This is the name for the kind of weakness in this report: the system gives out information it should have kept to itself. Nothing is broken or changed; the problem is that something private became readable. It is like a filing cabinet left in a public corridor: nobody broke in, but anyone walking past can read the files.
Brute-forcing and wordlists. Brute-forcing means trying many possibilities quickly and automatically. A wordlist is simply a long list of likely names (admin, backup, config, and so on) that a tool tries one after another. It is the digital version of trying every key on a keyring in a lock.
FFUF. FFUF is a free command-line tool that takes a web address and a wordlist and requests the address once for each word, showing you which words produced a real answer. It is used to discover hidden pages and folders.
Burp Suite. Burp Suite is a tool that records and lets you edit the web traffic between your browser and a site. It is how the researcher spotted the API address in the first place.
GitHub, Google dorks, Wayback URLs and JavaScript files. GitHub is a website where programmers publish code. A Google dork is a carefully worded Google search designed to find specific things, such as a particular string of text. The Wayback Machine is an archive that keeps old copies of web pages. JavaScript files are the code files a website sends to your browser to make pages interactive, and they sometimes contain addresses or strings. All four are places where a leaked secret might accidentally appear, so searching them is a way to check whether a secret is already public.
HackerOne and triage. HackerOne is a platform where bug bounty reports are submitted. Triage is the first review step: a team reads the report and decides whether it describes a real security issue. "Informative" is a status meaning the report was read but judged not to be a security risk.
The starting point
At the start of February 2021 the researcher received an invitation to a private program, meaning the program is not open to everyone; you have to be invited. The scope, which is the list of what you are allowed to test, was limited to one website with a dashboard.
Working on the dashboard first, the researcher found one valid bug there. Then, while reviewing the traffic in Burp Suite, the researcher noticed the dashboard was talking to an API at this base address:
https://redacted.com/api
This line is the address of the API itself, without any particular page after it. redacted.com stands in for the real company's domain, which has been removed to protect it. The /api part is the starting point under which all the API's features live. Everything in this write-up happens underneath this address.
How the work was set up
The testing was done against the private program's dashboard site. Burp Suite was used to inspect the traffic, and FFUF was used together with a wordlist the researcher usually customises, to try many possible names under the API address. No special account or role is described beyond access to the dashboard itself. The only thing that had to be true for the work to go ahead was that the API address was reachable and that the program's scope allowed this kind of discovery against it.
Finding the exposed key
The first thing worth doing against an API is to discover what content and directories exist under it. The reasoning is simple: an API is a collection of addresses, and you only know the ones the dashboard happens to use. Others may exist that nobody linked to, and those are often the interesting ones, because they were never meant to be seen by ordinary users.
So the researcher ran FFUF with a customised wordlist against the API path. FFUF took each word from the list, put it after https://redacted.com/api/, requested the result, and reported which ones answered. That surfaced an interesting directory called config:
This is the address FFUF found. config is short for configuration, the settings a piece of software uses. Settings files often contain addresses, feature switches and, unfortunately, secrets, because the software needs those secrets to work. That is exactly why this name is worth trying.
Checking the content of that address showed a token named LoginUrlSecretKey, whose value looked something like:
S#@x%^&$!1 …
This is the value of the key as it appeared in the response. The characters are a mix of letters, symbols and digits, which is what a secret looks like: it is not meant to be memorable, only hard to guess. The … means the value continued but is not shown in full. The name LoginUrlSecretKey is a strong hint: Login suggests it is used when logging in, Url suggests it is tied to a web address, and SecretKey says plainly that it is meant to be secret.
That value caught the researcher's attention. A key with a name like LoginUrlSecretKey, sitting in a directory that simple guessing can reach, is exactly the kind of thing that should not be publicly readable. If a settings file is reachable by anyone who guesses its name, then the secret inside it is not secret at all.

The screenshot shows the response from the config endpoint, with the LoginUrlSecretKey entry and its value visible.
Working out where the key is used
Having found what is probably a key used for API login, the researcher's main goal became finding where the token is used. The reason is that a secret is only as dangerous as what it unlocks. A key to a cupboard full of paperclips is not a serious problem; a key to the front door is. To judge the risk, you need to know what the key opens.
The researcher tried several methods and techniques to detect where the key is used, or to find any other useful information connected to it:
- The target program's GitHub repositories were searched for the secret key using GitHub search. No positive results were found. The idea here is that programmers sometimes accidentally commit secrets into their code, and if the key appears in the company's public code, you can see how it is used.
- Google dorks were used to look for any information related to the secret token. This was also negative. The idea is that a leaked key might appear in a forum post, a paste, a documentation page or anywhere else Google has indexed.
- Wayback URLs and JavaScript files were checked. This was also negative. The Wayback Machine keeps old copies of pages, which can reveal things that have since been removed, and JavaScript files are sent to every visitor's browser, so a key written into one would be visible to anyone who reads the file.
All three searches came back empty. That left two possibilities:
- The secret key is a dummy key used for testing purposes. In other words, it looks like a secret but is not used for anything real, so exposing it does no harm.
- The key is truly secret, as its name suggests, because nothing related to it turned up in the researcher's recon. If it were widely used or already leaked, you would expect at least some trace of it somewhere.
The researcher decided to report the issue on the basis of the second assumption. This is a judgement call, and it is worth understanding why it is reasonable: the absence of any public trace is evidence, though not proof, that the key is real and private. It is like finding a key under a doormat and checking that no copy of it has ever been posted online; that does not tell you which door it opens, but it does suggest the key is not a toy.
Reporting the bug and defending it
The timeline of the report was as follows:
| Date | Event |
|---|---|
| Feb 4, 2021 | The report describing the issue was sent. |
| Feb 5, 2021 | HackerOne Triage closed the report as Informative, stating that an app "leaking" these secrets does not necessarily mean there is a security risk, and invited the researcher to provide more details if the report was to be reconsidered. |
| Feb 5, 2021 | The researcher provided additional details about the recon process in determining why the key is secret, showing that no information related to it was found, based on the second assumption. |
| Feb 5, 2021 | HackerOne Triage forwarded the report to the internal team. |
| Feb 22, 2021 | The report was triaged by the HackerOne Triage Team. |
| Feb 26, 2021 | Severity was updated to High, a bounty of 800 US dollars was awarded, and the report was resolved with the fix confirmed. |
The first response is the most instructive part. Triage said that an app leaking secrets does not necessarily mean there is a security risk, which is a fair point: plenty of applications contain placeholder values that look like secrets but do nothing. The researcher could not show where the key was used, so the report as first written did not demonstrate harm.
The turning point was not proving where the key could be used, because the researcher could not, but flipping the argument. Instead of showing what the key unlocks, the researcher demonstrated through recon that nothing about the key exists publicly on the internet. That supports the conclusion that it is genuinely secret, and a genuinely secret key that anyone can read is a problem in itself. Once that evidence was in, the report was forwarded, triaged, rated High, paid, and resolved with the fix confirmed.
Why it happened
The config directory under the API address was discoverable by directory brute-forcing and returned a configuration document containing a secret named LoginUrlSecretKey. In other words, configuration data intended for internal use was served from a publicly discoverable path. The report does not describe the server-side code or the mechanism by which the directory was exposed, so the precise implementation mistake is not stated.
What the impact was
A secret used for API login purposes was exposed to anyone who could reach the config path. The report does not demonstrate the key being used against any endpoint, and the researcher could not determine where the key is consumed. The impact therefore rests on the key being genuinely secret, which the recon supported by finding no public references to it. Under that assumption, an attacker who obtained the key could use it for the API login purpose its name implies. The report does not state which systems or data that would give access to.
How it was fixed
The second part matters: once a secret has been readable by anyone, you cannot assume nobody read it, so the safe move is to replace it.
Things to try yourself
- Run directory and content discovery against API base paths with a customised wordlist, looking for names such as
config,settings,envand similar. A positive result is a response containing configuration data, keys or tokens. - When a secret is found, search the program's GitHub repositories, Google dorks, Wayback URLs and JavaScript files for it. A positive result is any public reference that shows where the key is used; a consistently negative result supports the argument that the key is genuinely secret.
- If a report of an exposed secret is closed as Informative, resubmit with the recon evidence showing the key is not publicly referenced anywhere, framed as proof of secrecy rather than proof of exploitation.

Glossary
- API (Application Programming Interface): the set of addresses and rules that software uses to exchange data with a service, as opposed to the pages a person clicks on.
- Authentication: the process of proving who you are, usually by logging in. A page that is reachable without authentication can be read by anyone.
- Base URL: the starting address of an API, before any particular feature or page is added.
- Big Data and Integration services: a company area that deals with very large amounts of data and connects different software systems together.
- Bounty: the money a company pays a researcher for a valid security report.
- Brute-forcing: trying many possibilities automatically and quickly, such as many folder names one after another.
- Burp Suite: a tool that records and lets you inspect and edit the web traffic between your browser and a website.
- Configuration (config): the settings a piece of software uses, often stored in a file or a directory that software reads at startup.
- Dashboard: the private, logged-in part of a website where a user sees and manages their data.
- Directory: a folder-like part of a web address, such as
configinhttps://redacted.com/api/config. - Dummy key: a placeholder value that looks like a secret but is not used for anything real.
- Endpoint: one specific address on a server that performs an action or returns data.
- FFUF: a free command-line tool that requests a web address once for each word in a wordlist and shows which words produced a real answer.
- GitHub: a website where programmers publish and share code.
- Google dork: a carefully worded Google search designed to find specific information, such as a particular string of text.
- HackerOne: a platform where security researchers submit bug reports to companies.
- Information disclosure: a weakness where a system gives out information it should have kept private, without anything being broken or changed.
- Informative: a report status meaning the report was read but judged not to describe a security risk.
- JavaScript file: a code file a website sends to your browser to make pages interactive; it is readable by anyone who visits the site.
- Private program: a bug bounty program that only invited researchers may test.
- Recon (reconnaissance): the information-gathering phase of security testing, before any attempt to exploit anything.
- Scope: the list of systems and actions a researcher is allowed to test.
- Secret key / token: a long string of characters that software uses to prove its identity, similar to a password but sent automatically by a program.
- Severity: a rating of how serious a security issue is, often from Low to Critical.
- Triage: the first review of a bug report, where a team decides whether it describes a real issue and how serious it is.
- Wayback URLs / Wayback Machine: an archive that keeps old copies of web pages, useful for seeing things that have since been removed.
- Wordlist: a long list of likely names that a tool tries one after another during discovery.