Live data from Hacker News

I scanned all of GitHub's "oops commits" for leaked secrets

trufflesecurity.com

61–70 of 117 posts

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#61

Unfortunately for those of us without a Google account, it seems one is required to download the mentioned SQLite database (force_push_commits.sqlite3.)

Concerning.

It's interesting research, but will Truffle Security use the email addresses for lead gen or marketing purposes, like how they mined users' pingbacks from their XSS Hunter fork for stats?

https://portswigger.net/daily-swig/new-xss-hunter-host-truff...

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#62
post #33

Earlier quoted context omitted.

There are hundred of setups like that already. If you push an AWS key or similar publicly you may have a bitcoin miner or botnet running on your cloud in matter of minutes.

Nope. Because if you push an AWS key then it gets automatically revoked by AWS.

I wouldn't rely on anything other than rotating leaked credentials.

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#63
post #29

Earlier quoted context omitted.

It's called private but actually shared with a very large corporation you don't control, likely running on infrastructure they don't control. Due to the CLOUD Act it's also shared with the US government.

Exactly; you should fully expect the NSA to have a copy of these logs as well. It can be very valuable to have secret keys from companies in adversarial countries (including your own). Example, there's an ICE reporting app now where people can anonymously report ICE sightings... but how anonymous is it really? Users report a location, that can be cross-referenced with location histories and quicky led back to an indi…

Right, so, some activists and freedom fighters have been doing stuff in environments they know to be hostile for a long time, while the US has just started growing some movements like that after a hiatus from sometime in the seventies and eighties until somewhat recently.

For now they're going to be making a lot of basic mistakes but eventually they'll grugq up and learn from people that are already used to dealing with the violence of their government.

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#64
post #40
post #30

> GitHub keeps these dangling commits, from what we can tell, forever. Not if you contact customer support and ask them to garbage collect your repo. What I do when I accidentally push something I don’t want public: - Force push; - Immediately rotate if it’s something like a secret key; - Contact customer support to gc the repo (and verify the commit is gone afterwards). (Of course you should consider the damage done…

If you rotated the secret, why do anything else? I don't think there is any potential further damage (except maybe reputational).

1. Not all secrets can be rotated. E.g. I can't just "rotate" my home address, which I prefer to be private.

2. Even for rotatable secrets, "I don't think there is any potential further damage" rests on the assumption that the secret is 100% invalidated everywhere. What if there are obscure and/or neglected systems, possibly outside of your control, that still accept that secret? No system is bug-free. If I can take steps to minimize access to an invalidated secret, I will.

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#66

Earlier quoted context omitted.

The person who leaked it and the person/team that can rotate it might be in different silos or timezones etc. Rewriting the history is prudent but not sufficient.

That's why key revocation, like credit card blocking, should be a separate service that is available 24x7. Like, if you know the value of an AWS token, this should be sufficient data for you to call an AWS API that revokes it.

That doesn't help if revocation, without renewal means immediate outage.

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#67
post #21

Maybe I missed it but the article doesn't mention the even easier way to see this: the activity tab. It has everything. Any force push to hide ugly prototype code is kept forever which annoys me. I wish we were able to remove stuff from there but the only way to do it is to email support it seems? Here it is for the test repo mentioned https://github.com/SharonBrizinov/test-oops-commit/activity

Where is that linked from? I've been using GitHub for years and never heard of this page.

Between "Readme" and "0 stars" on https://github.com/SharonBrizinov/test-oops-commit/

Looking at some of my projects, it's entirely empty, or only has a few items, so I suspect it was introduced "recently" and doesn't have data from before then.

Picking https://github.com/jellyfin/jellyfin/activity?sort=ASC as a busy example, Activity page has no data prior to 7th March 2023. So it has existed for 2 of GitHub's 17 years of existence.

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#68

Earlier quoted context omitted.

If I'm honest, I don't know how much this happens at work, and even if it does it's not the end of the world. Just scratch the commit from existence. In my head, the people who accidentally share secrets are also the people who couldn't setup trufflehog with a precommit.

This isn't true in practice. Even among well educated high performing professionals, mistakes happen. Checklists save lives - in medicine, in aircraft maintenance, in all fields. People who believe they know what they're doing get overconfident, move fast, and make mistakes. Seasoned woodworkers lose fingers. Experienced doctors lose patients to preventable mistakes. Senior developers wipe the prod database or make a…

It's crazy how many people don't know this, despite it being fairly obvious.

I guess it's hubris. I don't make stupid mistakes. You see it a lot in discussions around Rust.

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#69
post #21

Maybe I missed it but the article doesn't mention the even easier way to see this: the activity tab. It has everything. Any force push to hide ugly prototype code is kept forever which annoys me. I wish we were able to remove stuff from there but the only way to do it is to email support it seems? Here it is for the test repo mentioned https://github.com/SharonBrizinov/test-oops-commit/activity

Funny thing, we had a similar issue with one of our deployement in the past. It's similar to leaking accidently your password into bash history. Happens more than it should.

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#70
post #33

Earlier quoted context omitted.

There are hundred of setups like that already. If you push an AWS key or similar publicly you may have a bitcoin miner or botnet running on your cloud in matter of minutes.

Nope. Because if you push an AWS key then it gets automatically revoked by AWS.

AWS was just an example, but it kinda proves my point though, that people are already monitoring this ;)
Post reply on HN