Skip to content
Leaked secrets Write-up Beginner

GitHub Dorking Brought Us the Bounty

A developer's public GitHub repository contained source code for two of the target's subdomains, including an exposed .env file with development accounts and an API key for a critical third-party service. The API key allowed arbitrary read and write access to data, which the hunters demonstrated with curl commands.

medium.com

Published on medium.com

Friend Link

nocley, on medium.com

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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a developer committed a repository containing a .env file with live credentials and an API key to a public GitHub account.

Impact

The leaked API key allowed arbitrary read and write access to data tied to the subdomain's core functionality.

What the attacker needed

Public GitHub repository; leaked .env file with API key; no account needed on target

How it was found

  1. Search GitHub with dorking queries for configuration and environment files.
  2. Find a developer's public repository containing source code for two target subdomains.
  3. Compare frontend code with diffs to confirm it matches the target.
  4. Locate an exposed .env file holding dev accounts and a third-party API key.
  5. Use curl commands with the API key to write data and prove access.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Developers sometimes upload project files to public code hosting sites by mistake. A .env file is a small settings file that often holds passwords and secret keys, so if it is public, anyone can read those secrets. Here the leaked key let the finders read and change data in a third-party service the site relied on.

What is Leaked secrets?

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

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.