Skip to content
Leaked secrets Write-up Beginner

Exposing Secrets in Public Repositories Using GitLeaks: A Bug Bounty Learning Experience

Private keys and API tokens were exposed in public GitHub repositories, including in commit history and test folders. An attacker could use these secrets to access internal APIs, impersonate services, or tamper with software if the keys were tied to production systems.

amitgy04 Follow

Published on medium.com

When you’re starting your recon on a bug bounty target, always check whether the organization maintains any public GitHub repositories. Many researchers skip this — but it’s often a goldmine.

Amitishacked, 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, developers committed sensitive credentials into public repositories without using secret-scanning or proper .gitignore rules.

Impact

If the secrets were tied to production systems, they could allow attackers to access internal APIs, impersonate trusted devices or services, decrypt sensitive communications, or inject malicious code via the software supply chain.

What the attacker needed

Public GitHub repositories; secrets committed to the repo

How it was found

  1. Find public GitHub repositories linked to the bug bounty target.
  2. Run GitLeaks against the repositories to scan for secrets.
  3. Review the detected secrets to confirm they are real and potentially sensitive.

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.

Secrets like passwords or API keys are sometimes accidentally saved in public code repositories. Anyone can see them, and if they are real, they can be used to break into systems. This report found such secrets in two public GitHub repositories.

What is Leaked secrets?

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

More by amitgy04

View all

1 more disclosed report, best first.

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.