Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Sarah Gooding
April 23, 2024
In a recent discovery, GitHub was found susceptible to a CDN (content delivery network) flaw that allows attackers to host malware. This appears to be a security issue or a bug that exposes the risks associated with CDNs used by major software development platforms. It’s part of a growing trend where GitHub, a platform integral to software development, is becoming a vector for cybersecurity threats.
Last week McAfee reported that a new packed variant of the Redline Stealer trojan, a prevalent malware strain, was found to be leveraging Lua bytecode to perform malicious behavior. One notable feature of its infection chain is that the trojanized git repository appears to be hosted on Microsoft’s GitHub account.
https[:]//github[.]com/microsoft/vcpkg/files/14125503/Cheat.Lab.2.7.2.zip
What is actually happening here is that attackers have exploited this bug in GitHub comments to spread malware by uploading files that are then hosted in GitHub’s Amazon S3 instance for corresponding repository.
Last month software engineer Justas Masiulis tweeted an example of malware abusing GitHub attachments to create file links in legitimate repositories. The example referenced a file that appears to be hosted on the Microsoft MSRC Security Research GitHub repository.
GitHub does not appear to have taken any action against this type of abuse beyond simply removing the offending files.
Sergei Frankoff, co-founder of automated malware analysis services provider Open Analysis, tweeted a quick walkthrough video of how attackers can host malware or any type of file on other people’s repositories by exploiting GitHub issues and comments. He performed a demo on one of his own repositories.
“The way you do it is open an issue, and then drop your file into the issues,” Frankoff said. “It gets uploaded and saved under the tree of the GitHub repo, and then you can access it with that link.
“The stealthy way to do this is to actually just close the issue so you don’t actually submit it. Just upload the file in the message box and then, kill the issue and the file stays. So there’s no indication that you did that.”
Frankoff explained that the paths for /assets, traditionally used for releases, is confusingly similar to /files:
<github user>/<github repo>/assets/<file>
<github user>/<github repo>/files/<file>
Attackers leverage this confusion to lend their malware links more legitimacy. It’s similar to “starjacking” confusion where attackers link their package to a popular package's source code repository on GitHub that has a high number of stars.
Frankoff speculated that GitHub’s servers likely have forensics to identify more information about people who are abusing this mechanism. So far they haven’t been quick to crack down on this abuse.
One person responded on Twitter that he is using this vulnerability to use Github's CDN for uploading images to his blog. He creates an issue on his own repo, uploads images, and closes the issue to get a free CDN for his Netlify-hosted blog.
Bleeping Computer confirmed that the comments feature on GitLib is also subject to the same abuse, only with a different URL structure.
https[:]//gitlab[.]com/inkscape/inkscape/uploads/edfdbc997689255568a7c81db3f3dc51/InkScape-2024-Latest.exe
https[:]//gitlab[.]com/wireshark/wireshark/uploads/b4162053fbb4dc6ee4f673c532009e16/WireShark-v4.2.4-stable-release.exe
One notable difference is that GitLab users must be logged in to upload files, but having an account may not be a strong deterrent.
Beyond the seemingly innocuous abuse of GitHub’s CDN for hosting blog post images, there are many novel, malicious ways this bug could be used:
Open Analysis has a detailed writeup of how this GitHub bug was used to infect game hackers with Lua malware. It’s likely not the first attempt to abuse GitHub file uploads to deliver a malicious file. In addition to the piles of malware that’s openly hosted on the platform “for educational purposes,” GitHub has also struggled to contain the automated creation of repositories hosting obfuscated malware.
This method of abuse applies to any public repository on GitHub or GitLab. Developers and researchers should be aware of these techniques to disguise malicious software as legitimate projects. Never blindly download files from seemingly trustworthy locations, like popular GitHub repositories, without properly verifying their integrity.
Subscribe to our newsletter
Get notified when we publish new security blog posts!
Try it now
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.