The First Run Found a Live Key
A live API key was shipped in a public JavaScript bundle and allowed access to an internal account directory endpoint that lacked an authorizer. An attacker could retrieve a CSV of account administration data including security team details.
medium.com
Published on medium.com
Bug Bounty
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
SecretSniffer is a Go secret scanner built to replace grep-class secret finders. Instead of keyword lists, every provider gets a format-anchored rule: AWS, GitHub, GitLab, Slack, Stripe, Square, Shopify, Twilio, SendGrid, Mailgun, OpenAI, Anthropic, Hugging Face, Algolia, Mapbox, Postman, DigitalOcean, Heroku, private keys, JWTs and database URIs each get a rule matching the shape the credential actually has, not the word next to it. On top of the rules sit three layers most scanners skip: companion pairing, offline parsing and provider verification, followed by a triage pipeline that is where the noise dies.
The tool's first production run was against the JavaScript estate of an insurance company, gathered during a VDP engagement. The estate was 83,560 source files, fed to the scanner in one command. The run found a live API key that unlocked the company's internal account directory.

Setup
The corpus was the JavaScript estate of the insurance company, collected during a VDP engagement. The corpus was the JavaScript estate of the insurance company, gathered during a VDP engagement, and the scanner was run over it in a single command. The tool itself is open source, published as CypherNova1337/SecretSniffer on GitHub.
The run produced these numbers:
| Stage | Count |
|---|---|
| Raw matches | 11,246 |
| Unique candidates | 584 |
| Dropped, each with a named reason | 533 |
| Survivors shown for triage | 51 |
| Verified by provider | 0 |
| Reported dead (rejected by the provider it was tested against) | 1 |
The dead result matters as much as the find: the scanner reports a rejection on the record rather than silently discarding it or showing it as a hit.
Finding it
The 533 dropped candidates are the interesting part, because each bucket is a false-positive class a grep-class scanner would have printed and a human would have spent an hour on:
- 455, not a secret. Values that fail the format, the entropy floor, the charset, or the variable-name sanity checks.
- 51, low confidence. Right shape, not enough evidence.
- 18, placeholder or example. Published vendor examples (the AWS
EXAMPLEkeys, the Stripe test keys from the docs) and the RFC 6749 section-5 sample tokens. The sample access token2YotnFZFEjr1zCsicMWpAAand its refresh pair live inside every OAuth library's doc comment, and wordlist tools will keep flagging them. - 5, public by design. The Telerik licence-evidence JWT that ships in every Kendo bundle, and per-session values that are meant to be client-side.
- 3, real but harmless. A real secret shape in a context where it cannot hurt anyone.
- 1, dead. Sent to its provider, rejected, reported.
Some near-misses show what the raw output almost surfaced: CSS module names such as forgot-password-module__forgotPasswordForm, a stylesheet class with three character classes that scored as "password mixes 3+ character classes"; Chinese display strings ("cannot verify access token") scoring as high-entropy tokens; and minified code fragments such as +encodeURIComponent(ae)),Y+= extracted as a client_secret. Each got a drop reason instead of a report line.
Of the 51 survivors, two candidates sat in the same bundle family. One was a 40-character API key assigned to an apiKey configuration object, shipped in a public portal bundle for a cloud API host.
Exploitation
Step 1: confirm the key is live with a differential
The key was tested against the API host with three requests, differing only in the credential:
- Request with no key: 403 Forbidden.
- Request with a garbage key: 403 Forbidden.
- Request with the shipped key: 200, returning a 623-kilobyte CSV.
The three responses differed only in the credential: 403, 403, 200.
Step 2: read what came back
The CSV was 454 rows by 45 columns of the company's internal account administration directory: account names, business units, account owners, access approvers, business and technical contacts and access report subscriptions. The second row was the company's own security team's production account, with approvers listed. The key the portal shipped to every visitor was the key to the directory of everyone who runs the platform.
Step 3: map the rest of the API surface
Every other endpoint was tested as well. Each answered 403 regardless of the key, because those endpoints sit behind a session authorizer. A garbage bearer token received the authorizer's rejection, which proves the requests were reaching the route layer rather than being blocked earlier.
Step 4: state only what the responses prove
The report therefore says exactly this: the key passes the gateway for the whole API, one endpoint was missing its authorizer, and that endpoint is the one that handed over the directory. There is no account-takeover speculation. The finding was verified twice with identical bytes and the receipts were saved.
Root cause
The key was a real credential embedded in a public portal bundle, assigned to an apiKey configuration object for a cloud API host. The gateway accepted it across the API, but the other endpoints still enforced a session authorizer. The directory endpoint was missing that authorizer, so the gateway-level key was the only check standing between a visitor and the directory. The directory endpoint was missing the session authorizer its siblings use, so the gateway-level key was the only check on it.
Impact
Anyone who loaded the public portal bundle could extract the key and, with it, download the internal account administration directory: 454 rows by 45 columns covering account names, business units, account owners, access approvers, business and technical contacts and access report subscriptions, including the security team's own production account. The exposure is read access to that directory through the one unauthenticated endpoint. The other endpoints remained behind the session authorizer, so the key alone did not grant access to them.
Fix
The report does not describe a fix applied by the company. What the finding calls for is removing the key from the public bundle and putting the directory endpoint behind the same session authorizer as the rest of the API, so that a gateway-passing key is not sufficient on its own.
Variants to test
- Differential key testing on any API host named in public JavaScript. Send the request with no key, a garbage key and the shipped key. A positive result is 403, 403, 200 with a body, which proves the key is live and the endpoint is reachable.
- Endpoint-by-endpoint authorizer mapping. With a valid gateway key, walk the API surface and record which routes answer 403 and which do not. A positive result is one route returning data while its siblings reject the same credential, which points at a missing authorizer.
- Companion pairing checks on partial credentials. Look for identifiers such as a Twilio account SID without its auth token. A positive result is a credential whose companion is found nearby; without the companion, the match is dropped with the reason written out.
- JWT depth checks. Parse header, issuer, role and expiry. A positive result is a Supabase
service_rolekey, which bypasses row-level security and should be treated as critical, or an expired token that should be dropped. - Placeholder filtering before triage. Exclude the AWS
EXAMPLEkeys, Stripe test keys and the RFC 6749 sample token2YotnFZFEjr1zCsicMWpAAwith its refresh pair. A positive result is a candidate that survives these filters and still verifies against its provider.
What happened, in plain words
A security researcher built a tool that searches large collections of computer files for secret passwords and keys that should never have been left in them. The tool is called SecretSniffer and it is written in a programming language called Go. On its first production run, it was pointed at the JavaScript estate of an insurance company, gathered during a VDP engagement. Out of 83,560 files it produced 11,246 raw matches, narrowed them to 584 unique candidates, threw away 533 with a written reason for each, and left 51 for a human to look at. Two of those 51 looked promising. One of them turned out to be a working key that let the researcher download a spreadsheet of the company's internal account directory: 454 rows and 45 columns listing who works where, who owns which account and who approves access. The key was shipped in a public portal bundle.
This article walks through that run from the beginning, explaining each idea as it comes up. You do not need any security background to follow it. If a word looks unfamiliar, the glossary at the end defines every term used here.

The tool
SecretSniffer is published as open source on GitHub under the name CypherNova1337/SecretSniffer. Open source means the code is public and anyone can read it, run it or suggest changes.
Most secret-finding tools work like the search box in a text editor: they look for words such as password or api_key and print every line where those words appear. That approach produces enormous amounts of noise. A typical run might print ten thousand lines, of which three are real secrets, and those three are buried among CSS class names and sample values copied from documentation.
SecretSniffer takes a different approach. For each service whose keys it knows how to recognise (Amazon Web Services, GitHub, GitLab, Slack, Stripe, Square, Shopify, Twilio, SendGrid, Mailgun, OpenAI, Anthropic, Hugging Face, Algolia, Mapbox, Postman, DigitalOcean, Heroku), it has a rule that describes the actual shape of that service's credential, not the word that happens to sit next to it. It also recognises private keys, JWTs and database connection strings. A useful comparison: instead of searching a crowd for anyone wearing a badge, you search for a badge of a specific size, shape and colour. Far fewer false alarms.
On top of those shape rules, the tool adds three layers that most scanners skip:
- Companion pairing: some credentials only work as a pair, so the tool looks for the partner nearby.
- Offline parsing: it actually reads and decodes structured values such as private keys, rather than just pattern-matching text.
- Provider verification: where a service offers a safe, read-only way to check a key, the tool asks the service whether the key is real.
After all that comes a triage pipeline, which is the stage where the noise is removed. Triage means sorting: deciding which items deserve a human's attention and which can be set aside, with a reason recorded for each decision.
The run
The material the tool was pointed at was the JavaScript estate of an insurance company. JavaScript is the programming language that runs in your browser and makes web pages interactive. A company's JavaScript estate is the collection of all the JavaScript files its websites serve to visitors. It was gathered during a VDP engagement. A VDP, or vulnerability disclosure programme, is a scheme where an organisation invites outside researchers to report security problems in its systems, usually with rules about what is allowed and what is not.
The estate was 83,560 source files. They were fed to the scanner in one command, meaning the researcher did not click through a website by hand; a single instruction started the whole scan.
The run produced these numbers:
| Stage | Count |
|---|---|
| Raw matches | 11,246 |
| Unique candidates | 584 |
| Dropped, each with a named reason | 533 |
| Survivors shown for triage | 51 |
| Verified by provider | 0 |
| Reported dead (rejected by the provider it was tested against) | 1 |
Reading the table from top to bottom: the scanner first found 11,246 places that looked like they might contain a secret. Many of those were duplicates of the same value, so after removing repeats there were 584 distinct candidates. Of those, 533 were thrown away, and for every single one the tool wrote down why. That left 51 for a person to review. Of those, none could be confirmed as working by asking the service that issued them, and one was actively reported as dead, meaning the service it was tested against said the key was not valid.
That last line matters as much as the find. A tool that only ever says "I found something" is not trustworthy, because you cannot tell its real hits from its mistakes. A tool that also says "this one is not real, and here is the proof" is telling you something useful about its own reliability.
The noise it cut
The 533 dropped candidates are worth reading, because each group is a type of false positive: something that looks like a secret but is not. A grep-class scanner, meaning one that just searches for words, would have printed all of them, and a human would have spent an hour on each.
- 455, not a secret. These values failed one of the tool's basic checks: the expected format, the entropy floor, the character set, or the variable-name sanity checks. Entropy is a measure of randomness. Real keys look random; English words and code fragments do not. An entropy floor is a minimum randomness score a value must reach before it is taken seriously. The variable-name check looks at what the value was assigned to in the code: a value stored in a variable called
passwordis more suspicious than the same value stored in a variable calledlabel. - 51, low confidence. These had the right shape but not enough supporting evidence to be worth a human's time.
- 18, placeholder or example. These are values published by the companies themselves as examples in their documentation. Amazon's documentation uses keys containing the word
EXAMPLE, and Stripe publishes test keys that are meant to be used in development. The tool also excludes the sample tokens from RFC 6749 section 5, a public document that describes how OAuth works. OAuth is the system that lets you click "Sign in with Google" on another website. The sample access token2YotnFZFEjr1zCsicMWpAAand its refresh pair appear inside the documentation comments of nearly every OAuth library, so wordlist tools will keep flagging them forever. - 5, public by design. These are values that are supposed to be visible to anyone. One example is the Telerik licence-evidence JWT that ships inside every Kendo bundle. A JWT, or JSON Web Token, is a compact string that carries information and is often used to prove who you are. Some are meant to be public. Another example is per-session values that are designed to live in the browser.
- 3, real but harmless. These had the genuine shape of a secret, but sat in a context where they could not cause harm.
- 1, dead. This one was sent to the service that issues that kind of credential, and the service rejected it. The tool reported that rejection rather than hiding it.
Some near-misses show what a simpler tool would almost have shown you:
- CSS module names such as
forgot-password-module__forgotPasswordForm. CSS is the language that controls how a web page looks, and this is the name of a style rule. The tool's rule for passwords checks whether a value mixes three or more character classes (uppercase, lowercase, digits, symbols), and this stylesheet name happened to do so. A layout system was being treated as if it were a credential. - Chinese display strings such as "cannot verify access token" scored as high-entropy tokens, because to a program that only measures randomness, unfamiliar characters can look random.
- Minified code fragments such as
+encodeURIComponent(ae)),Y+=were extracted as aclient_secret. Minified means the code has been squashed to save space, so fragments of real code end up looking like random strings.
Each of these got a drop reason instead of a report line. That is the difference between a tool that hands you a pile and a tool that hands you a shortlist.
The find
Of the 51 survivors, two candidates sat in the same bundle family. A bundle is a file that packages lots of JavaScript together so the browser can download it in one go. Both candidates came from the same group of bundles.
One of them was the classic real thing: a 40-character API key assigned to an apiKey configuration object, shipped in a public portal bundle for a cloud API host. An API, or application programming interface, is the set of addresses a website's code can talk to in order to fetch or change data. Think of it as the service counter at a shop: you do not walk into the stockroom, you ask at the counter and the counter fetches what you need. A cloud API host is the server that answers those requests. A configuration object is a small block of settings in code, and this one held the key under the name apiKey. Because the bundle was public, every visitor to the portal received the key along with the page.
Exploitation
Exploitation means using a weakness to see what it actually allows. The researcher did this carefully, in steps, and recorded what came back at each one.
Step 1: confirm the key is live with a differential
A differential test means sending nearly identical requests that differ in exactly one thing, and comparing the answers. Here the one thing that changed was the credential. The key was tested against the API host with three requests:
- Request with no key: 403 Forbidden.
- Request with a garbage key: 403 Forbidden.
- Request with the shipped key: 200, returning a 623-kilobyte CSV.
HTTP status codes are the short numbers a server sends back to say how a request went. 403 Forbidden means "I understood you, and I am refusing". 200 means "here is your answer".
Why three requests instead of one? Because a single 200 would prove nothing. Perhaps the address answers 200 to everybody, key or no key. Perhaps the server ignores the key entirely and the 200 had nothing to do with it. By sending the same request with no key, with a nonsense key and with the real key, the researcher ruled out both explanations. The first two were refused; only the real key was let through. That pattern, 403, 403, 200, is what proves the key is live and that the endpoint is actually checking it.
A CSV is a comma-separated values file, a plain spreadsheet format that any spreadsheet program can open. 623 kilobytes is roughly the size of a few hundred pages of plain text.
Step 2: read what came back
The CSV was 454 rows by 45 columns of the company's internal account administration directory. In plain terms, it was a spreadsheet of who has which account, who owns it and who signs off on access to it. The columns covered account names, business units, account owners, access approvers, business and technical contacts and access report subscriptions.
The second row was the company's own security team's production account, with its approvers listed. In other words, the people whose job is to protect the company appeared near the top of the list that had just been handed out.
The key the portal shipped to every visitor was the key to the directory of everyone who runs the platform.
Step 3: map the rest of the API surface
A single working key on a single address is a finding, but it is not the whole picture. To describe the problem accurately, the researcher tested every other endpoint as well. An endpoint is one specific address in an API, the way a counter has different windows for different services.
Each of the other endpoints answered 403 regardless of the key, because those endpoints sit behind a session authorizer. A session authorizer is a check that asks "is this person logged in, with a valid session?". A session is what a website remembers about you after you log in, usually kept in a cookie, a small piece of data your browser stores and sends back with each request. A bearer token is a credential sent in a request header, a small labelled field attached to the request, to prove the caller is allowed in.
When the researcher sent a garbage bearer token, the authorizer rejected it. That rejection is useful evidence: it proves the requests were reaching the route layer, the part of the system that decides which code handles which address, rather than being blocked earlier by something that never looked at the token at all. In everyday terms, it proves the parcel reached the front desk and was refused there, not lost in the post.
Step 4: state only what the responses prove
The report therefore says exactly this: the key passes the gateway for the whole API, one endpoint was missing its authorizer, and that endpoint is the one that handed over the directory. A gateway is the front door that all API requests pass through. Passing the gateway means the key was accepted at that front door. But the other endpoints had a second check behind the door, the session authorizer, and the directory endpoint did not.
There is no account-takeover speculation. Account takeover means logging in as someone else and acting as them; the researcher did not claim that, because the responses did not show it. The finding was verified twice with identical bytes, meaning the same download was repeated and produced exactly the same content, and the receipts were saved. Keeping receipts, the actual responses received, is what lets a report be checked later by the people who have to fix the problem.
Root cause
Root cause means the underlying reason the problem existed, as opposed to the symptom. The key was a real credential embedded in a public portal bundle, assigned to an apiKey configuration object for a cloud API host, so every visitor to the portal received it. The gateway accepted it across the API, but the other endpoints still enforced a session authorizer. The directory endpoint was missing that authorizer, so the gateway-level key was the only check standing between a visitor and the directory.
The directory endpoint was missing the session authorizer its siblings use, so the gateway-level key was the only check on it. In everyday terms: the building has a front door that checks one kind of pass, and most rooms have a second lock that checks a different one. One room was fitted without its second lock, and the front-door pass was enough to walk in.
Impact
Impact means what harm the weakness could actually cause. The key shipped in the public portal bundle gave access to the internal account administration directory: 454 rows by 45 columns covering account names, business units, account owners, access approvers, business and technical contacts and access report subscriptions, including the security team's own production account.
The exposure is read access to that directory through the one unauthenticated endpoint. Read access means seeing the data, not changing it. Unauthenticated means no login was required. The other endpoints remained behind the session authorizer, so the key alone did not grant access to them. That limit is part of the finding, not a footnote: it is the difference between a report that can be trusted and one that overstates its case.
Fix
The report does not describe a fix applied by the company. What the finding calls for is removing the key from the public bundle and putting the directory endpoint behind the same session authorizer as the rest of the API, so that a gateway-passing key is not sufficient on its own. In everyday terms: stop printing the front-door pass on the leaflets you hand out, and fit the missing second lock on the room that did not have one.
Variants to test
Variants are other situations where the same ideas can be tried. Each one below is written as a test with a clear positive result, so you know what success looks like before you start.
- Differential key testing on any API host named in public JavaScript. Send the request with no key, a garbage key and the shipped key. A positive result is 403, 403, 200 with a body, which proves the key is live and the endpoint is reachable.
- Endpoint-by-endpoint authorizer mapping. With a valid gateway key, walk the API surface and record which routes answer 403 and which do not. A positive result is one route returning data while its siblings reject the same credential, which points at a missing authorizer.
- Companion pairing checks on partial credentials. Look for identifiers such as a Twilio account SID without its auth token. A SID is an identifier, not a secret; on its own it tells you which account something belongs to but does not let you in. A positive result is a credential whose companion is found nearby; without the companion, the match is dropped with the reason written out.
- JWT depth checks. Parse header, issuer, role and expiry. A positive result is a Supabase
service_rolekey, which bypasses row-level security and should be treated as critical, or an expired token that should be dropped. Row-level security is a database feature that limits which rows each user can see; a key that bypasses it can see everything. - Placeholder filtering before triage. Exclude the AWS
EXAMPLEkeys, Stripe test keys and the RFC 6749 sample token2YotnFZFEjr1zCsicMWpAAwith its refresh pair. A positive result is a candidate that survives these filters and still verifies against its provider.
Glossary
- API (application programming interface): the set of addresses a website's code can talk to in order to fetch or change data.
- API host: the server that answers API requests.
- Authorizer: a check that decides whether a request is allowed to proceed.
- Bearer token: a credential sent in a request header to prove the caller is allowed in.
- Bundle: a file that packages lots of JavaScript together so a browser can download it in one go.
- Companion pairing: looking for the second half of a credential that only works as a pair.
- Configuration object: a small block of settings in code.
- Cookie: a small piece of data a website stores in your browser and your browser sends back with each request.
- CSS: the language that controls how a web page looks.
- CSV (comma-separated values): a plain spreadsheet format that any spreadsheet program can open.
- Differential test: sending nearly identical requests that differ in one thing, and comparing the answers.
- Endpoint: one specific address in an API.
- Entropy: a measure of randomness; real keys look random, English words do not.
- Entropy floor: a minimum randomness score a value must reach before it is taken seriously.
- False positive: something that looks like a secret but is not.
- Gateway: the front door that all API requests pass through.
- Go: a programming language often used for command-line tools and servers.
- grep-class scanner: a tool that finds secrets by searching for words, like the search box in a text editor.
- HTTP status code: the short number a server sends back to say how a request went; 200 means success, 403 means refused.
- JavaScript: the programming language that runs in your browser and makes web pages interactive.
- JavaScript estate: the collection of all the JavaScript files a company's websites serve to visitors.
- JWT (JSON Web Token): a compact string that carries information and is often used to prove who you are.
- Minified: code squashed to save space, so fragments of it can look like random strings.
- OAuth: the system that lets you click "Sign in with Google" on another website.
- Open source: code that is public and that anyone can read, run or suggest changes to.
- Placeholder: an example value published in documentation, not a real credential.
- Provider: the service that issues a credential, such as Amazon or Stripe.
- Provider verification: asking the service that issued a key whether the key is real, using a safe read-only check.
- Read access: being able to see data without being able to change it.
- RFC 6749: a public document that describes how OAuth works.
- Root cause: the underlying reason a problem existed, as opposed to the symptom.
- Row-level security: a database feature that limits which rows each user can see.
- SID: an identifier that says which account something belongs to; on its own it does not let you in.
- Session: what a website remembers about you after you log in.
- Session authorizer: a check that asks whether the caller is logged in with a valid session.
- Source file: one file of code as written by a developer.
- Triage: sorting items to decide which deserve a human's attention, with a reason recorded for each decision.
- Unauthenticated: reachable without logging in.
- VDP (vulnerability disclosure programme): a scheme where an organisation invites outside researchers to report security problems under agreed rules.
- Verification: checking that a credential actually works, rather than assuming it does.