r/programming • • Mar 27 '23

Twitter Source Code Leaked on GitHub

https://www.cyberkendra.com/2023/03/twitter-source-code-leaked-on-github.html
8.0k Upvotes

717 comments sorted by

View all comments

0

u/[deleted] Mar 27 '23

[deleted]

108

u/Spiritual-Ad-8062 Mar 27 '23

Yes, and I wonder how many secrets (API keys, SSH keys...) were in the code... ready for attackers to use...

179

u/VonThing Mar 27 '23

Zero secrets in the code, but I see your point.

-1

u/TheWhyOfFry Mar 27 '23

Just curious, have you seen the code? (Where if so?) How are you sure no secrets?

14

u/VonThing Mar 27 '23

Go through my post history lol

I’m ex-Twitter so yes I have seen the code

-6

u/TheWhyOfFry Mar 27 '23

I mean, if it’s a local fork or branch that was published, are you sure they didn’t have any keys for local dev? I’ve worked at places that have secret management for dev and prod envs but didnt solve for working local and connecting to dev, which meant you had to get keys and have them local in some instances.

4

u/ItzWarty Mar 27 '23 edited Mar 27 '23

Large companies do extensive work to ensure

  1. API keys can't be pushed - they're not even managed by developers. CI scans for them too. In many cases, if you even create & attempt to push a commit with an API key, it'll be revoked.

  2. Dev & prod are completely separate environments. Most developers will never have these secrets. And once again, they're deployed far away from source.

  3. Data isolation - a backend service serving user A cannot accidentally access confidential data from user B. This enforcement happens at the data-layer, so that it does not matter how buggy an application is. It's not like people are just writing $"select * from table where name={name}" everywhere. There are multiple layers of data-access within these companies.

Honestly, FAANGs operate at such a large scale (tens of thousands of engineers). They do great work to make it so even a 'complete idiot' cannot accidentally create a vulnerability, which is why it is surprising if it does happen. A significant amount of the root-cause-analysis would fall on the data-access team, not the mistaken engineer.

BTW there are many alternatives to having raw DB credentials. For example, application containers can be provisioned with a port-forward to a trusting data access layer. In that scenario, the application is literally sandboxed from the API keys.

→ More replies (2)