He Made $64K Searching GitHub With A GENIUS Trick (using open source only)


He Made $64K Searching GitHub With A GENIUS Trick
(using open source only)

This issue is brought to you by:

TestSprite is the Easiest AI Agent for

Software Testing


Ensure End-to-End Confidence in Your Software Quality.  

This, is the story of how one individual, "Mr. B," leveraged a deep understanding of Git's less-explored features to uncover secrets in public repositories, earning over $64,000 💰.

His "genius trick" wasn't about finding new tools, but about using existing Git functionalities in ways most developers and even many security professionals overlook.

The real goldmine often lies beneath the surface

We're used to interacting with Git through commands on our current working directory and recent history.

However, Git is designed to never lose data easily.

Mr. B's approach highlights that secrets committed, even to branches that are later deleted, or files removed from history via commands like git commit --amend or git rebase, don't just vanish.

The files that are harder to find, can persist as "dangling" or "unreachable" objects within Git's internal object database (.git/objects) for a period before potential garbage collection (usually 14 days).

These are invisible to standard git log or file browsing but are recoverable if you know where and how to look.

To put these learnings into action, especially in today's environment where AI can empower even junior attackers, requires a shift in mindset.

The big problem is the persistent risk of sensitive data: API keys, cloud credentials, private tokens being committed to Git repositories.

Once committed, even if "deleted" from the main branch or recent history, these secrets can become ticking time bombs.

What most people do

Most people, and many automated tools, try to solve this by scanning the current version of the code or perhaps the visible commit history.

They might assume that if a secret isn't in the latest commit or if a branch containing it was deleted, the risk is mitigated.

This approach often doesn't work because Git's architecture is (WAY) more complex.

Git stores all file versions and directory structures as objects.

When history is rewritten or branches are deleted, the old objects aren't immediately purged!

They become "loose" or "dangling" objects.

Eventually, Git might "pack" these objects into compressed packfiles, still within the .git directory, before they are eventually garbage collected, but this process isn't instantaneous.

Standard scanning methods miss these orphaned artifacts.

A new approach

Mr. B's successful strategy, was to dig into Git's internals.

This involves:

Exploring the Object Database: Using Git plumbing commands like

// fsck: identify objects that are no longer referenced by any commit, branch, or tag but still exist
git fsck --full --unreachable --dangling

Unpacking Archives:

// decompress packfiles, potentially revealing older, hidden objects
git unpack-objects

Full History Traversal: Systematically going through every commit in the repository's history using

git rev-list --all

and examining the diff for each commit against its parent.

This can uncover files that were added and then quickly removed, a common pattern for accidental secret exposure.

Targeted Scanning:

Once these potentially sensitive historical artifacts and dangling objects are recovered (even if they are just raw blobs without filenames), use a robust open-source scanner like TruffleHog, configured to scan the raw file content for various secret patterns. Mr. B turned it on with switches to run on the file system with all detectors:

trufflehog filesystem --only-verified --print-avg-detector-time --include-detectors="all" ./ > secrets.txt

This methodical deep dive into the repository's underlying metadata, rather than just its surface, is what allowed Mr. B to find secrets that thousands of others, using conventional methods, missed.

It’s a reminder that understanding the fundamental workings of our tools is paramount for robust security.

Our hero also mentioned he:

  1. Only "attacked" organizations with official bug bounty programs that allow it
  2. How he built a home lab and a bunch of cloud servers to run his scans
  3. A "vibe coded" cool UI to look into the files found
  4. A list of bounties amounting to $64K USD!

Personally, I applied the same process, scripting it, and looking for my own target.

So I cloned and scanned and cloned and scanned, until one repo POPPED.

I found a few admin keys in a Kubernetes open source used by thousands of people and I was excited!

My advice to you: learn the methods, at least be familiar with Git's strange metadata (and actual content) processes, and build a similar process embedded into the release process to avoid future storms!

The full blog post is here.


Thank you for reading.
Feel free to reply directly with any question or feedback.
Have a great weekend!

ESPRESSO FRIDAYS

Every once in a while I send hand picked things I've learned. Kind of like your filter to the tech internet. No spam, I promise!

Read more from ESPRESSO FRIDAYS

You’ve been parsing JSON wrong your whole life This issue is brought to you by: Secure Your AI Future at DevSecCon 2025 Software development is undergoing a seismic shift as AI transforms how we build, deploy, and secure applications. Register for the 1st-ever Global Community Summit on AI Security, covering critical strategies to empower AI innovation without compromising security. Register for DevSecCon 2025 (It’s Free!) Ever opened a massive “.log” file and realized it’s just one long,...

Wait… cURL can do WHAT?! Brought to you in collaboration with 1Password and Browserbase: 🔐 Your AI Agents Can Finally Log In! 1Password and Browserbase just partnered to solve AI’s biggest security nightmare: authentication without exposing credentials. Introducing 1Password’s Secure Agentic Autofill, allowing you to connect your 1Password Enterprise Password Manager to your browser automation agent powered by Browserbase. Build AI agents that can actually work without compromising security....

Postgres is not a database. For years, we’ve been taught to see Postgres as the reliable, open source workhorse for storing our data. Everyone called it "The Toyota of databases", you know... it just works. But to leave it at that is to miss the whole story.Postgres isn’t just a place to put your data, it’s a powerful development platform that can become the core of your entire backend, an operating system (yea, bold) for your application’s stack. Diving deep into its capabilities I learned...