r/programming • u/geek_noob • Mar 27 '23
Twitter Source Code Leaked on GitHub
https://www.cyberkendra.com/2023/03/twitter-source-code-leaked-on-github.html522
u/bdcp Mar 27 '23
where's the link
537
u/Kallu609 Mar 27 '23
Based there's only 4 directories all starting with "a" I think it got shutdown before the upload was fully done.
Hopefully there's torrent soon š“āā ļø
→ More replies (10)872
u/ToughQuestions9465 Mar 27 '23
Thats not how git works. Its all or nothing. Interrupting a push would result in no changes to remote repository.
→ More replies (61)
3.8k
u/Karenomegas Mar 27 '23
"The social media company launched an investigation into the leak and executives handling the matter have surmised that whoever was responsible left the San Francisco-based company last year."
That's some fine work there lou.
1.8k
u/PaintItPurple Mar 27 '23
I hear the person who did it is between 3 and 8 feet tall.
670
u/TonySu Mar 27 '23
Investigators have determined that the culprit most likely has an identity and distinguishable features.
→ More replies (2)370
→ More replies (16)10
292
Mar 27 '23
This is Papa Bear. Put out an APB for a male suspect, driving a... car of some sort, heading in the direction of, uh, you know, that place that sells chili. Suspect is hatless. Repeat, hatless.
100
→ More replies (7)8
94
u/DevonAndChris Mar 27 '23
Al Sutton, cofounder and chief technology officer of Snapp Automotive, was a Twitter staff software engineer from August 2020 to February 2021. He noted in a tweet on Tuesday that Twitter never removed him from the employee GitHub group that can submit software changes to code the company manages on the development platform. Sutton had access to private repositories for 18 months after being let go from the company, and he posted evidence that Twitter uses GitHub not only for public, open source work, but for internal projects as well. Within about three hours of posting about the access, Sutton reported that it had been revoked.
https://www.wired.com/story/mudge-twitter-whistleblower-security/
It was insane and probably still is.
→ More replies (8)69
u/JustSpaceExperiment Mar 27 '23 edited Mar 27 '23
I think it was someone who had access to them.
→ More replies (1)112
u/Fig1024 Mar 27 '23
what do you mean - leaked? didn't Elon Musk himself said he was gonna release all the source code on GitHub so that community could help maintain it?
→ More replies (1)91
u/kevinhaze Mar 27 '23
He said he was going to release the source code of the recommendation algorithm
→ More replies (145)42
u/Unable-Fox-312 Mar 27 '23
Executives have surmised that whoever was responsible probably worked at Twitter at some point.
23
6
23
→ More replies (12)9
119
u/kubelke Mar 27 '23
Maybe I could fix those āpopular tagsā, and once I click on them I get complete garbage
30
u/KingApologist Mar 27 '23
It's weird to me that what's "popular" is usually some corporate marketing announcement or something a political entity is currently spending a lot of marketing money on.
→ More replies (1)14
185
747
u/lazernanes Mar 27 '23 edited Mar 27 '23
The company could face a lawsuit for intellectual property theft, which could result in huge fines and damage to its reputation
I don't understand. A disgruntled ex-employee leaks the code and twitter gets sued? By whom? for what?
Edit: The article was edited. The line I quoted is no longer there.
998
u/plaid_rabbit Mar 27 '23
If Twitter used anyone elseās IP/patents or FOSS software that required sharing source code.
116
u/crazedizzled Mar 27 '23
You typically don't have to provide source code for closed web apps. At least under the GPL, deploying code to your own servers doesn't count as distribution.
However it's possible if they've licensed some other intellectual property not meant to be publicized, that could indeed get them in trouble.
→ More replies (14)58
→ More replies (1)110
u/ghostinthekernel Mar 27 '23
I think the issue is when you fork that code, or does simply using a library package entail you have to open source the project you use it into? Genuine question.
253
117
u/plaid_rabbit Mar 27 '23
Depends on the license. IANAL. It varies by the license. MIT requires no sharing. I know thereās some FOSS licenses that require you to share any modifications if you allow users to connect publicly to your app. Most only require you to share if you directly modify the library and distribute it.
→ More replies (5)→ More replies (26)24
u/danhakimi Mar 27 '23
It depends on a whole lot more than what the others mentioned. What's the license? Is the code in question being distributed or not? How does the code interact with the package--static link, dynamic link, scripting language import, what? Is the code being modified?
I am a lawyer. I am not your lawyer, and none of this is legal advice. I've worked in this field for years, and it's fairly complicated.
→ More replies (7)35
49
→ More replies (9)4
54
43
Mar 27 '23
Twitter Source Code Partially Leaked on GitHub
Gotta make sure you get those qualifiers in there
3
205
u/lafeber Mar 27 '23
A small API change had massive ramifications. The code stack is extremely brittle for no good reason.
Will ultimately need a complete rewrite.
33
u/WhipsAndMarkovChains Mar 27 '23
Someone link to the recording from a couple months ago where Musk says a āfull stack rewriteā is needed and a former senior engineer from Twitter presses him on the issue. The engineer asks an extremely reasonable question like āwhatās wrong with the current stack and what do you want to switch to?ā and Musk canāt respond.
92
u/PM_YOUR_SOURCECODE Mar 27 '23
Ok, so all the engineers who had to pass BS LeetCode interviews/whiteboarding couldnāt write a flexible and maintainable codebase? Is that the conclusion here?
64
u/pale_blue_is Mar 27 '23
As someone who works at an unremarkable company and earns a wage slightly above market value, aren't you talking about basically every silicon valley startup from the past 10 yrs?
17
u/BasicDesignAdvice Mar 27 '23
Those stupid tests are at every company. I work at a household name media company making video games no where near Silicon Valley. Same shit.
221
27
u/TheWhyOfFry Mar 27 '23
I mean, itās very possible that it was a brittle code base before they got well known and could be selective about who they hire. And itās also possible the v1 api that powered external apps couldnāt be shut down because of the massive backlash it would cause, which could force Twitter to keep some bad code in there.
That said, musk probably just doesnāt understand the language itās written nor the architecture and fired anyone who understood it. Of course itās ābrittleā when you make totally incompatible changes because you have no idea what youāre doing.
20
u/KagakuNinja Mar 27 '23
As Twitter was becoming more popular, they rewrote the system, moving from Ruby to Scala. Scala is a niche language, and depending on how it is used, can get very hard to understand, especially for people unfamiliar with functional programming.
That said, Twitter devs had a great reputation, and when I interviewed there, I got the impression that they were not FP zealots.
→ More replies (1)→ More replies (9)7
Mar 27 '23
Yeah because lc has nothing to do with actual software engineering and who ever came up with the idea to interview like that needs to be slapped
→ More replies (3)4
u/lazilyloaded Mar 27 '23
for no good reason
Sure, but the bad reason is "because you executive types always want the new features yesterday"
2
Mar 27 '23 edited Nov 17 '24
jeans apparatus gaping versed divide retire close alleged books grandiose
This post was mass deleted and anonymized with Redact
4
→ More replies (1)5
26
25
u/redingerforcongress Mar 27 '23
Anyone got a copy, for reasons?
→ More replies (1)68
u/Chazzey_dude Mar 27 '23
In unrelated news I'm launching my own social media website called Twidter
20
u/zzt0pp Mar 27 '23
Brand it as āretroā 2022 Twitter before view counts and blue checkmark chaos
→ More replies (3)4
u/no-more-nazis Mar 27 '23
Don't forget to leave some references to the original codebase like TruthSocial did
86
u/ttkciar Mar 27 '23 edited Mar 28 '23
Cool! I hope it pops up on TPB soon. I'd like to take a peek.
Edited to add: still not seeing anything at https://thepiratebays.ink/search.php?q=twitter&all=on&search=Pirate+Search&page=0&orderby=
→ More replies (3)
16
13
u/trevg_123 Mar 27 '23
writes pull request
Commit message: āMake the world a better placeā
Diff: [all files deleted]
90
u/jnkthss Mar 27 '23
The company is worried that the leak may result in a data breach or a cyberattack, which could seriously damage the reputation of the company.
Because we all know that their reputation is flawless so far. /s
8
9
u/Flimsy_Inevitable_15 Mar 27 '23
Breach forums still live's on in spirit.
2
u/backwards_watch Mar 27 '23
Damn, I still am shocked on how stupidly easy was poom's arrest. The dude literally shared his own personal email. One line of one message and everything went downhill.
2
41
u/Fiskepudding Mar 27 '23
Jokes on you, I know how to use "View page source" /s
→ More replies (1)7
u/eldelshell Mar 27 '23
Wait until you learn about 'Save as...'
→ More replies (1)3
u/Fiskepudding Mar 27 '23
This one simple trick developers don't want you to know. Elon Musk hates him!
7
Mar 27 '23
Fun read on the topic. https://www.arnica.io/blog/defending-against-source-code-exfiltration-fast-and-slow
29
u/Maskdask Mar 27 '23
Should leaked source code imply security vulnerabilities? There are tonnes of secure open source projects out there. Doesn't that just imply that they have shitty code with bad security?
59
u/Zbee- Mar 27 '23
It's not the fact that the software became public that implies the security vulnerabilities, you are correct in that, but rather the fact that software which was intended not to be public became public.
One key difference is that open source software is or was designed to be open source, and as such has been aware of that vulnerability the whole time.
Closed source software was not designed that way, and instead used obscurity as a layer in their security, and as such may have bits in the code that an open source piece of software would not have in the same code base or may have much more limited access - for example, anything related to security controls may be in a separate codebase for an open source piece of software but might be in the same codebase for a closed piece of software.
It does not inherently mean that there are vulnerabilities that can now be exploited, but it does mean that vulnerabilities that may exist and were solely unfound by means of obscurity are now indeed more exploitable - obscurity that may have been maintained even if the rest of the code were open source. The implication is that without the software having been designed in the public eye and being subject to public audits the whole time that there are more likely to be vulnerabilities revealed.
Additionally, it also depends largely on the overall design of the application anyway - if it's not a monolithic codebase that was released then it may well not reveal anything of relevance. And finally, it may well also reveal vulnerabilities/exploits that are only revealed by being able to read the code and it's specific quirks, the same issues open source projects have, but they are able to plug up because of public audits.
So it does not necessarily imply the code is bad, rather just that a layer of their security just failed and it could lead to worse.
Edit: correct I-typed-this-on-my-phone typos
→ More replies (6)
5
u/isowolf Mar 27 '23
So many people are flabbergasted that leaked source code will eventually lead to security vulnerabilities and bashing on the "quality" of the code without even seeing it, have probably never worked a day on a massive 15-year-old codebase.
Please stop listening to the non-sense Elon is saying for the code. I bet he doesn't even understand whats going on, just speaking out of his ass.
4
4
u/DimasDSF Mar 28 '23
So they've finally fired all the programmers and are looking into getting free work from the opensource community huh?
116
u/osirisguitar Mar 27 '23
If your security is built on the code being kept secret, it's not built right.
254
u/chx_ Mar 27 '23
It does not need to be built on it, merely the fact it's harder to break into a black box than breaking into something you can read the code for.
I was always bothered by the almost zealotry level of "security by obscurity is bad and you should feel bad" screeching. Security by obscurity is a completely valid part of a multilayer security approach. Alone it is terrible but that doesn't really happen. But seriously, something as simple as moving your SSH behind SSLH does enhance your security. Maybe not by a lot but it does keep most script kiddies away so hey.
31
u/archiminos Mar 27 '23
Security only by obscurity is bad. But that doesn't mean you shouldn't be using obscurity.
19
u/LuckyHedgehog Mar 27 '23
Obscurity might not be security, but you also don't see tanks painted orange
→ More replies (10)110
u/kRkthOr Mar 27 '23
The idea that security by obscurity is useless is so fucking stupid. It's not the be all and end all of security but goddamn how do you not come to the conclusion that helping attackers isn't the best way to go about things.
71
u/gnus-migrate Mar 27 '23
The context of this mantra is the cryptography space where the market was full of companies developing proprietary ciphers that were marketed as secure, and who refused to share the code for "security reasons". As far as I know that's the case, I remember first hearing about it in Dan Boneh's cryptography course. The point is that for cryptographic algorithms, you can't rely on obscuring the code as a protection measure, as it's not needed to break the cipher, and once it is you've basically compromised everything encrypted in this format.
Like the "premature optimization is the root of all evil" quote, it was misunderstood and reshared without that context.
→ More replies (1)→ More replies (2)5
u/Queueue_ Mar 27 '23
The argument I always see is that it's useless on it's own. You should design it to be hard to break into even if they know how it works regardless of if you expect them to or not.
23
11
u/pheonixblade9 Mar 27 '23
it's not about the code being kept secret being the only thing keeping you secure. when a malicious party gains information about your system, it just makes it easier and more efficient for them to do malicious things.
2
→ More replies (2)9
u/VonThing Mar 27 '23
It isn't. Secrets are kept separately. You're still right though.
→ More replies (2)10
u/Mattho Mar 27 '23
Secrets and security are related, but not what OP was talking about most likely.
31
u/FuzzYetDeadly Mar 27 '23 edited Mar 27 '23
I'm actually curious to know how their algorithm that detects that someone created a new account after getting suspended (and re-suspends them) works. Like what regex or method do they use? Unfortunately I have no idea where to even start looking to find out how this works.
Edit: thanks for the responses everyone, it's been very informative and gives me many options to explore to find a solution
83
u/myringotomy Mar 27 '23
The same way reddit does it. Browser fingerprinting.
→ More replies (12)3
u/FuzzYetDeadly Mar 27 '23
Thanks for the knowledge, I need to read up on this as I don't really understand how it works (haven't worked with web/mobile technology much)
20
u/schmuelio Mar 27 '23
Long and short of it is your web browser tells you a lot of information about:
What extensions it has installed
What version it's running
What OS it's on
What human-interface devices are available (mouse, keyboard etc.)
What resolution your screen is
What hardware capabilities you have (for things like canvas/webGL)
What system fonts you have installed
Etc.
All of this can be combined together to make a fingerprint of your browser that is nearly unique. It's possible to share a browser fingerprint with other people by happenstance, but generally speaking it's very rare.
You can see a breakdown of the stuff you can get from a browser to fingerprint it here.
→ More replies (6)2
→ More replies (5)-7
u/Articunos7 Mar 27 '23
It most likely detects the IP address. There's no need for regex here
35
u/pheonixblade9 Mar 27 '23
it's way more complex than that, and likely involves a lot of factors.
9
u/F54280 Mar 27 '23
OP wanted to know if such algo was going to be released. However, if it involves a lot of factors, then it isnāt a prime candidate⦠goes ^^hiding
12
u/Ilbsll Mar 27 '23
Probably just cookies/local storage and browser fingerprinting on top of IP address. Can't really see it getting much more sophisticated than that.
→ More replies (2)
14
u/BiDinosauur Mar 27 '23
Wild how taking over a functioning company then treating everyone there like garbage doesnāt create wild success.
→ More replies (1)
3
3
5
u/ImAStupidFace Mar 27 '23
The company moved quickly to send a copyright infringement notice to GitHub, an online collaboration platform for software developers, to have the leaked code taken down. It is unclear how long the code had been online, but it appeared to have been public for several months.
Gonna leave this paragraph here without comment.
2
2
2
Mar 27 '23
He promised to do that on 3/31. But now heās mad because his promise was actually fulfilled. He never intended on delivering otherwise he wouldnāt care.
2
2
u/lqstuart Mar 27 '23
Most junior software engineers in SV know how to design Twitter from scratch on a whiteboard in 45 mins for a system design interview, not sure what value the decade-old source code adds
1
1
1
1
1
Mar 27 '23
Fun, but if enough people pull this stunt weāll eventually find ourselves working through a laggy RDP session.
1
1
1
1
1
1
1
1
1
1
1
1
1
u/redzeusky Mar 28 '23
Wasnāt their user database exfiltrated to the dark web a few months ago? How did that fall out of view?
1
u/catchmonster Mar 28 '23
So what, intellectual property. Twitter. Please give me a break. There is nothing you will learn or see in that code. Chill...
1
1
1
u/eyeofperception Mar 28 '23
Man, dudes gonna see the dark side of Elon. I am quite terrified to imagine that.
1
u/SimonGray653 Mar 30 '23
How much you want to bet it won't be 2 months before we already have a Twitter competitor because of the of the source code being leaked?
→ More replies (1)
1
u/Conscious-Place7438 Mar 31 '23
So whywho backed up the repo before it was taken down?
Did anyone use the Wayback Machine to archive the code?
1
1
1
Mar 27 '23
I applaud the hero or heroes who leaked the code. Now whoever has the interest can build the platform cheaply and improve.
1
u/mtnviewcansurvive Mar 27 '23
these folks keep meeinting our friend Karma> its odd tho....no one seems to like Karma...
1
1
1
u/n0obno0b717 Mar 27 '23
Iām an AppSec engineer and I assist with DFIR at work. Having IP leaked is never good, people need to think about all the companies that have twitter, and the amount of sensitive data they twitter owns.
I wonāt be surprised if they suffer a larger breach months down the line or some of their B2B clients.
-28
u/greenw40 Mar 27 '23
ITT: A bunch of programmers cheering on code theft because they hate Elon. Just like when you guys decided that you hated open source because of him.
12
→ More replies (2)2
Mar 27 '23
Biggest douchebag of the century. And he has absolutely nothing to do with open source.
→ More replies (8)
-19
u/msolace Mar 27 '23
Dunno if this is really a big thing. the code to do twitter really isn't that complicated tbh, writing a twitter clone is a common programming challenge for classes/ interview....
The logistics for tracking/ad serving/ logistics /threading it properly for speed, and the massive DB backend.
Does look bad though, and can do other harm, maybe...
→ More replies (1)8
u/Temporary-Ambition-1 Mar 27 '23
The code to write the idea of Twitter is easy, the code to write Twitter with the users and interactions Twitter has is the difficult part
0
Mar 27 '23
[deleted]
89
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...
105
u/SuitableDragonfly Mar 27 '23
If there had been API keys leaked, they probably would have noticed when it was first leaked because bots would have immediately acquired them and started mining crypto on their cloud account. Or, maybe not, depending on which people Elon fired.
179
u/VonThing Mar 27 '23
Zero secrets in the code, but I see your point.
→ More replies (10)13
Mar 27 '23
[removed] ā view removed comment
159
u/MinMaxDev Mar 27 '23
there was tonnes of this in the twitch codebase, it happens
→ More replies (9)8
→ More replies (3)13
u/Aerodrache Mar 27 '23
⦠considering Muskās apparent strategy of firing anyone he suspects of being smarter than himā¦?
→ More replies (4)1
0
Mar 27 '23
[deleted]
257
u/PeterSR Mar 27 '23
I like how their profile picture is a randomly generated GitHub identicon, yet also a middle finger.
→ More replies (3)23
6
u/Dreamtrain Mar 27 '23
"FreeSpeechEnthusiast"
plot-twist: it's actually elon staging a "leak"
10
u/--Satan-- Mar 28 '23
Elon had his engineers literally print out code for a code review. I don't think he knows how to use git.
→ More replies (1)4
u/TotallyAdmin Mar 28 '23
Repository metadata available at https://api.github.com/users/FreeSpeechEnthusiast/repos
First created 2023-01-03T23:24:14Z (3rd January 2023)
Last code change (push) 2023-03-24T02:24:50Z (24th March 2023)
Last repository update (likely when dmca'd processed) 2023-03-27T11:47:24Z (27th March 2023)
Size as returned by the api is 1748467 in KB (could be incorrect) (1.7GBs).
We can also see the repository was starred/watched by some user(s)?, and whilst there are is way to use any of the /repo/ endpoints, the /users/ endpoint gives some more info
View the recent commit history here https://api.github.com/users/FreeSpeechEnthusiast/events View who starred the repository here https://api.github.com/users/FreeSpeechEnthusiast/received_events
2
1
0
Mar 27 '23
[deleted]
1
u/darkwoodframe Mar 27 '23
I honestly thought he said a couple months ago he was going to make it all available.
0
0
Mar 27 '23
[deleted]
1
Mar 27 '23
Please donāt keak it is not a good practice to use the same tool for the first few years or so and it is a very good idea gRAPPOEEES HAHAHAHAHAHAHAHAHGAHAHAHAHAH
-11
Mar 27 '23
[removed] ā view removed comment
4
u/deuterium0 Mar 27 '23
You are correct. Security through obscurity is a terrible design. Downvoted by noobs.
4
977
u/SickOrphan Mar 27 '23
Didn't Elon say he was going to open source some parts of twitter soon?