gitleaks / gitleaks

Protect and discover secrets using Gitleaks 🔑
https://gitleaks.io
MIT License
18.04k stars 1.48k forks source link

Detecting private keys and seed phrases for cryptocurrency wallets #1082

Open andrewschreiber opened 1 year ago

andrewschreiber commented 1 year ago

Is your feature request related to a problem? Please describe. One attack vector of cryptotheft is the accidental checking in of private keys (and to a lesser extent seed phrases) into repos. Detecting this could be tremendously valuable for anyone building in web3.

https://www.microsoft.com/en-us/security/blog/2022/05/17/in-hot-pursuit-of-cryware-defending-hot-wallets-from-attacks/

Describe the solution you'd like Regex rules to support the detection of seed phrases and private keys. https://chainstack.com/how-do-ethereum-and-solana-generate-public-and-private-keys/

Additional context None

cc @zricethezav

andrewschreiber commented 1 year ago

Perhaps useful points of reference

https://github.com/sepinf-inc/IPED/issues/558

https://stackoverflow.com/questions/16727206/regular-expression-for-base-58-private-key/16738021#16738021