BACK TO ARCHIVE
2026-02-20P2 HIGH
CASE #0079

Private Key Pushed to Public GitHub; Bot Wallet Drained

A developer accidentally committed their OpenClaw bot's private key to a public GitHub repository. An attacker discovered the key via automated scanning, recovered the wallet, and drained it of $200 within hours.

CONFIRMED
🔓 SECURITY LEAK💸 FINANCIAL RUIN
Incident Brief

A developer building an OpenClaw bot stored the bot's wallet private key in a .env file. While pushing routine changes, a misconfigured .gitignore let the .env file through, exposing the key in a public repository. Automated scanners (of which many exist, tuned for exactly this pattern) detected the key within minutes of the push. The attacker recovered the associated wallet and drained the full $200 balance. Git-history rewrites after the discovery were too late — the key had already been copied by scanners. The $200 loss was small, but the incident serves as a canonical example of the supply chain between 'careless .gitignore' and 'drained wallet' taking minutes, not days.

AFFECTED USERS: ~1

ESTIMATED COST: $200

Root Cause

The Actual Culprit

A .gitignore that didn't match .env combined with no pre-commit secret scanner. Once a secret is pushed to a public repo, even briefly, it must be considered compromised.

What Was Done
[--]Attempt to rewrite git history and force-push
[OK]Developer installs pre-commit secret-scanning hook (gitleaks)
[OK]All bot keys rotated + .env patterns added to global .gitignore
Lessons Learned
git-commit

Pre-commit secret scanners are not optional

gitleaks, trufflehog, and similar tools catch the vast majority of key leaks before they reach the remote. If you handle any kind of secret, install one.

git-branch

Public git history is forever

Rewriting history does not help once scanners have copied the commit. Treat any secret that touched a public remote, even for seconds, as burned.

Comments (0)

Loading comments...

0/1000
Case Info
Case Number
#0079
Severity
⚠️P2 HIGH
Severity Level
Date
2026-02-20
Affected Systems
Developer Workstation
Wallet
Public Git Repository
Source
twitter
Published: 2026-02-20