Attack campaign involving stolen OAuth tokens issued to third-party integrators
github.blog
github.blog
I am always uneasy when an application even thrust worthy like sentry asks access to ALL my private repositories even when they dont need it.
I feel that in 2022 GitHub is way too critical to many organizations and they should really work on stricter rules. Even google requires special and costly audits from oauth applications to access users critical data like drive and emails.
https://games.greggman.com/game/github-permission-problem/
Github has (had) some of the worst wording in the permission prompts as well as too many 3rd party apps asking for blanket permission to do anything and everything in all your repos. It might as well be "hey, give us root on your servers and our new service will do cool things for you!"
And even worse is the 1000s and 1000s of repos that have signed up for those services including all kinds of popular libraries. They've given the keys to hack the libraries at will to 10s or 100s of random companies that integrate with github. It's insane.
This. Limiting OAuth app access to specific repositories. I really wish this was a thing. For this exact reason I'm creating a new GitHub account for every new integration and share the repo with this account. It's technically against the TOS (they only allow single bot account per user) but there is no other way if you want security.
Maybe GitHub will implement this feature now. My hopes are high.
Edit: nevermind OAuth tokens are not org-scoped, only apps are
Just noting that gitlab has supported per repo tokens for ages. Yes, it's really useful, as this incident can attest.
You’ll also discover this if you try to create a personal access token, it’s all repos, you can’t limit them to a particular repo.
Their sec org is impressive, so these occasional massive things have been surprising
Unless I'm missing something, this attack could have gone unnoticed for a long time (it would be hard for someone to connect a random breach in their infrastructure to an oauth intrusion affecting two of their service providers).
(Submitted title was "Some Salesforce private GitHub repos stolen")
"Salesforce continues to investigate this incident in coordination with GitHub and our retained third-party breach vendor. Once we identify how the threat actor gained access to customers' OAuth tokens, we will immediately take appropriate actions."
Sounds like they simply don't know yet how the actor got access and what else was exposed.
The compromised tokens could provide the threat actor access to customer GitHub repos, but not customer Heroku accounts
While the situation can get worse, this token alone may not be enough...
mTLS is definitely an excellent step towards solving this.
Does this imply there was unencrypted AWS credentials stored in an NPM repository and/or possibly GitHub? Seems like a bad idea, though I’m sure it’s hard to get off that practice if you’ve been on it for a long time.
???
↓
Heroku/Travis OAuth token
↓
Private GitHub repo
↓
S3 token for NPM prod infraLarge organisation, hundreds of developers. Kind of likely that something is visible somewhere. Still a bit surprising it’s the prod access keys for npm…
Perhaps we could start validating that a token not only is valid, but also is digitally, freshly signed with a known certificate?
I'd say there's a huge difference between:
* I stole a token
* I stole the token AND am able to keep signing said token with my victim's public certificate
A token can be stolen from many places and is comparatively easy to obtain, while full intrusion into an org's infrastructure is less likely, and even if it happens, eventually will be remediated (and the related certificate will be revoked).
Edit: looks like https://tools.ietf.org/id/draft-ietf-oauth-mtls-09.html would fit the bill.
AWS and Mastodon use HTTP request signing which seems interesting.
[1] https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-mes...
https://developer.mastercard.com/blog/why-mastercard-doesnt-...
> Heroku Dashboard (ID: 145909)
> Heroku Dashboard (ID: 628778)
> Heroku Dashboard – Preview (ID: 313468)
> Heroku Dashboard – Classic (ID: 363831)
> Travis CI (ID: 9216)
Developers at Heroku and Travis are going to have a rough Friday
For example, my site, serverthiefbait.com might help...
I can't see anything mentioned on the incident page nor config vars page
It's pretty plain that source code exfiltration occurred, though. It's not clear to me how exactly to confirm that the exfiltration happened to your account or not.
From the other thread:
> GitHub indicates they are performing an audit and if they find such evidence they will notify each account/org within the next 72 hours.
Hope it can help some of the organizations dealing with this right now!
https://blog.gitguardian.com/a-practical-guide-to-prioritize...
So it seems like if your company had some super secret project running on github, heroku, AWS, they had full access to it.
This is my rough understanding just skimming so could be wrong.
Or did they get one Oauth key each from Heroku and Travis that exposed all of their customers data on github? Are there keys that would do this, set up for what purpose?
Heroku boasts:
> we will notify affected customers by email without undue delay.
4 days. Really. "without undue delay".
[1] https://github.blog/2022-04-15-security-alert-stolen-oauth-u...
13-14, so "only" 1-3 days later, depending on what GitHub mean and timezones involved.
Some questions that come to mind:
* Would encrypted secrets for GitHub Actions be exposed to these tokens?
* How to best audit for unauthorized access to exposed repos?
* Were Heroku encrypted secrets exposed?
Not just any Friday, but Good Friday, which happens to be a legal holiday in many countries, including here in Germany. And since Easter Monday is one too, a lot of people will go on vacation on this "long" weekend (maybe even taking a couple of days off before or after to make it even longer)... Flights and hotel rooms booked, and all that.
GitHub indicates they are performing an audit and if they find such evidence they will notify each account/org within the next 72 hours.