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 🏴☠️
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 (1)302
u/roboticon Mar 27 '23
Presumably the code was stolen onto a thumb drive or uploaded somewhere, then later whatever they got was published on GitHub as a git repo
286
u/Wingfril Mar 27 '23
I mean when I was there as an intern 5 years ago, that’s how they distributed the code… through a thumb drive.
→ More replies (3)169
→ More replies (7)2
u/strangel8p Mar 27 '23
This is a cache from January 4. Most push events happened on the night of March 23, so there was likely a lot more code there for a few days. The full history of events is saved in GH Archive, which you can query, for example, from this clickhouse mirror:
3
u/strangel8p Mar 27 '23
And twitter found this pretty fast as they filed a takedown notice about 12 hours later https://github.com/github/dmca/blob/master/2023/03/2023-03-24-twitter.md
→ More replies (1)
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
u/atedja Mar 27 '23
Culprit also had access to github
236
8
10
10
5
→ More replies (13)2
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
u/14domino Mar 27 '23
The suspect is directly under the earth’s sun .. nnnnow
11
u/Yossarian_Noodle Mar 27 '23
I can't wait for them to throw his hatless butt in jail.
→ More replies (2)14
8
8
3
→ More replies (2)4
u/Timmyty Mar 27 '23
The suspects were looking around the neighborhood in an agitated fashion and had their hands in their waistbands.
→ More replies (3)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
83
u/Fig1024 Mar 27 '23
maybe that's what he was trying to do but because he's a dumbass he uploaded the whole thing. Then rather than claim responsibility for the mistake he said someone leaked it
→ More replies (144)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
9
→ More replies (11)4
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.
58
48
u/craze4ble Mar 27 '23
Or alternatively, there are licenses that stipulate that commercial use is disallowed, requires some form of royalties, or that everything must be open sourced under the same license.
→ More replies (13)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 (2)34
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 (4)10
u/henk53 Mar 27 '23
Is the code in question being distributed or not?
Many people here seem to overlook this basic question.
→ More replies (2)56
u/vanatteveldt Mar 27 '23
The answer is somewhat complicated and might depend on the license of the library package and the definition of 'derived work'. My 2 cents (IANAL):
- If the library or package is licensed LGPL, MIT or another non-copyleft license (i.e., not GPL), there should be no problem
- If you're linking to a GPL'd library (i.e. importing it), the situation is more complicated, see e.g. https://en.wikipedia.org/wiki/GPL_linking_exception and its sources
44
u/chx_ Mar 27 '23
IANAL but the GPL does not restrict your rights when using it, it applies if you try to distribute your code.
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope.
They needed to make the AGPL so people who use the software over a network will be able to get the source code for it.
→ More replies (7)33
→ More replies (2)10
u/myringotomy Mar 27 '23
If the library or package is licensed LGPL, MIT or another non-copyleft license (i.e., not GPL), there should be no problem
There might be. Some of those licenses require attribution.
→ More replies (4)→ More replies (8)7
u/Unable-Fox-312 Mar 27 '23
You are supposed to know the license terms for all software you incorporate into your project
4
u/far_in_ha Mar 27 '23
or FOSS software that required sharing source code.
I wish!!! Look at all Android manufacturers not doing it and still no consequences to this day.
35
49
4
→ More replies (7)3
u/MrRumfoord Mar 27 '23
What is that quoted from? Because it's not in the article. Maybe the article was edited?
3
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.
20
Mar 27 '23
11
u/lyzurd_kween_ Mar 27 '23
elon musk is so highly regarded and incompetent when it comes to actual software work, i am shocked he was able to reach the stature he currently has. right place at the right time i guess.
→ More replies (4)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
u/Marrk Mar 27 '23
The conclusion is Musk has no idea what he's talking about
→ More replies (16)11
u/voidstarcpp Mar 27 '23
Musk has made many public fumbles speaking technically about Twitter but it's not like there's any shortage of complaints about product quality from current and former employees, including well before the sale to Elon.
→ More replies (2)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)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)→ More replies (8)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?
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 (1)11
4
u/no-more-nazis Mar 27 '23
Don't forget to leave some references to the original codebase like TruthSocial did
1
u/_parfait Mar 27 '23
Repository unavailable due to DMCA takedown.
welp, there goes my Silicon Valley dream down the drain...
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 (1)7
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
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.
18
Mar 27 '23
Also known as Kerckhoffs’s principle and dates back to the 19th century - Roughly, "the system must not require secrecy and must be able to be stolen by the enemy without causing trouble."
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.
→ More replies (1)9
Mar 27 '23
Yep. It's fair to design your defences based on the assumption that the enemy knows your base, but it's still stupid to hand out your floor plan just because of that
2
u/yiliu Mar 27 '23
Alone it is terrible but that doesn't really happen.
Ha!
Especially back when this mantra was new, it was really common for companies to rely almost entirely on obscurity.
In the past decade, I've worked for one major company where the leaking of their source code would be somewhere between slightly annoying and totally irrelevant from a security perspective...and another for which it would be a devastating blow.
→ More replies (8)3
u/PurpleYoshiEgg Mar 27 '23
"Security by obscurity" refers to specifically security by way of primarily obscurity. As part of defense in depth, obscurity can (and should) be judiciously used, especially when it does not impact usability.
Having my SSH servers listen on port 20222 might not make it more secure in the grand scheme of things by itself, but the fact is that I am much less likely to get bots trying random passwords and zero days on that port than port 22.
However, there is something to be said for making it more inconvenient, because placing SSH ports on 22 will make it much easier to type.
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)→ More replies (11)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.
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.
977
u/SickOrphan Mar 27 '23
Didn't Elon say he was going to open source some parts of twitter soon?