December 3, 2026
R.I.P Commit History: How Deleted Data Stayed Alive in a Public GitHub Repo
By wadaa
3 min read
When the security team scrubs the latest file, but leaves the entire history sitting right in the commit log.
Disclaimer: This write-up is published for educational and defensive awareness following responsible vulnerability disclosure. Any organization names, repository paths, commit hashes, researcher usernames, private report titles, and internal endpoint details have been anonymized or omitted to protect privacy and adhere to disclosure guidelines.
Every developer knows the classic rule of version control: deleting a secret in a new commit doesn't delete it from Git. Yet even seasoned security teams occasionally fall into the exact same trap — cleaning up future automation output while leaving the original sensitive data preserved in the commit history.
During passive GitHub reconnaissance on target, I stumbled across a public repository (target-org/bug-bounty) that did just that—accidentally exposing private HackerOne report metadata, researcher profiles, and even the existence of a confidential private bug bounty program (target-private).
Here is how a routine look at git log turned into an eye-opening lesson on why scrubbing the HEAD commit is never enough.
Passive Recon: Finding the Automation Repo
While mapping publicly accessible GitHub repositories tied to target, one repository stood out:
- Repository:
[https://github.com/target-org/bug-bounty](https://github.com/target-org/bug-bounty)
Looking through the codebase, it appeared to be an internal automation utility built to track and synchronize HackerOne report data (likely pulling metadata via the HackerOne API).
At first glance, the current HEAD state of the repository looked clean. No API tokens, no obvious credentials, and no sensitive report titles staring back at you on the main branch.
So, naturally, I clicked on the Commits tab.
Following the Breadcrumbs in Git History
In GitHub recon, the most interesting commits are often the ones where someone tried to remove or hide something.
While inspecting the commit history, a specific remediation commit caught my eye (<redacted-remediation-commit>). The change modified the automation script so it would stop populating report titles and program names in future runs.
That raised an immediate question: If they just stopped writing title and program_name going forward, what was already committed before this change?
Viewing the Diff and Parent Commits
- Opening the commit diff on GitHub immediately showed the removed lines in red — revealing the original, unredacted data schema that the automation script had been committing.
- Checking out a prior commit (such as
<redacted-parent-commit>) and browsing the historical data file exposed the full, unredacted dataset in plain sight.
No authentication, no brute-forcing, and no non-public GitHub tricks were required — just standard public repository browsing.
What Was Sitting in the History?
The historical commits contained a structured record of HackerOne submissions across both target's public program (target-public) and its private, invite-only program (target-private), including:
- Private Program Existence & Activity: Repeated references to
target-privateconfirmed the existence and ongoing activity of an invite-only bug bounty program meant to remain confidential. - Sensitive Report Titles & Affected Assets: Several historical report titles explicitly named vulnerability classes alongside affected hosts, IPs, CVE identifiers, or specific vulnerable API paths (and even referenced underlying report IDs).
- Third-Party Researcher Metadata: HackerOne usernames and profile avatar URLs of the researchers who submitted those reports were tied directly to the exposed report titles without their consent.
The Illusion of Partial Remediation
What made this finding particularly interesting from a defensive perspective was the evidence of awareness right in the commit history:
- The team clearly realized that syncing report titles and program names into a public repo was a bad idea.
- They updated the script to strip those fields from future commits and eventually removed the data file from the active branch.
- However, because Git retains every historical snapshot by default, removing or altering a file in a later commit only hides it from the latest view — leaving the original payload permanently retrievable via
git logor GitHub's commit URLs.
How to Actually Purge Sensitive Data from Git
When sensitive metadata or secrets land in a Git repository, editing the file in a new commit gives a false sense of security. Proper remediation requires rewriting history:
- Rewrite and Purge Commit History: Use tools like
git filter-repoor BFG Repo-Cleaner to completely remove the sensitive file and commits from every branch and tag—not just the latest commit. - Force-Push (or Recreate the Repo): Force-push the cleaned history to the remote repository, or delete and recreate a clean public repository from scratch if cached commit views still retain references.
- Audit Related Repositories: Check other repositories under the same GitHub organization (
target-org) for similar "deleted in a later commit" artifacts. - Prevent Future Leaks at the Door: Add generated data paths to
.gitignoreand enforce pre-commit/CI secret scanning hooks (such as Gitleaks or TruffleHog).
Key Takeaway
In Git, hitting "delete" doesn't erase the past — it just adds another chapter to the history book. Whether you're managing API keys or bug bounty metadata, always treat historical commits as public forever until history is genuinely rewritten.