• The code could have given hackers a chance to steal data from the platform
  • Twitter issued a subpoena to online platform GitHub on Friday
  • It also asked GitHub to identify the person who shared the source code online

Some parts of Twitter's source code were leaked online and were available for months, the company said in a court filing.

The source code, which is the fundamental computer code on which the social network runs, could have reportedly given hackers a chance to steal data from the platform or even take down the site.

The leak came to light after Twitter took legal action to take the code down from the online platform GitHub, according to documents filed by the Elon Musk-headed company with the U.S. District Court for the Northern District of California.

Twitter issued a subpoena to the Microsoft-owned company Friday and said a GitHub user, named "FreeSpeechEnthusiast," had shared excerpts of the company's source code, according to court documents.

The San Francisco-based company asked GitHub to identify the person who shared the source code online without its permission.

GitHub, which describes itself as a code hosting platform for version control and collaboration, complied with Twitter's request and took the code down from the platform the very same day, CNBC reported.

The New York Times first reported the news and said the code was available to the public on GitHub for several months. Two sources with knowledge of the internal probe reportedly said hackers could have accessed the code to find Twitter's security vulnerabilities. Consequently, they could use the code to steal user data or even take the social network down.

Court documents also revealed the person who leaked the code was someone who left the company last year. The username could be a reference to Musk's previous comment that he's a free speech absolutist.

However, Twitter executives handling an internal probe reportedly found out about the leak only recently.

In the court filing, Twitter also asked the federal court to force GitHub to identify those who downloaded the leaked pieces of source code.

Twitter has been in turmoil since Musk took over the company last October for $44 billion. The social media giant saw 75% of its employees leaving or being fired as part of a massive layoff after Musk became its CEO.

Twitter's recent court filing about the leaked source code comes on the heels of a Federal Trade Commission probe into Musk's mass layoffs and the company's privacy and cybersecurity practices.

Elon Musk has put the value of his Twitter platform at $20 billion, less than half what he paid for it five months earlier