How secure are public software repositories in general?
Cybersecurity researchers recently discovered cryptocurrency-stealing malware that was distributed through the NuGet developer platform disguised as 13 fake packages.
The sophisticated typesquatting campaign, described in detail by JFrog experts, consisted of attackers presenting their malware as popular legitimate packages often used by developers. The effect was achieved by copying the names of these popular packages, albeit with minor changes. And since even legitimate packages often have complicated names, it doesn't cost anything for developers to accidentally confuse packages and download malware onto a computer.
The two-stage attack culminated in the deployment of a permanent .NET-based "Impala Stealer" backdoor capable of gaining unauthorized access to victims' cryptocurrency wallet accounts.
"The payload used a very rare obfuscation technique called .NET AoT Compilation, which is much more stealthy than using off-the-shelf obfuscators, but also makes it difficult to reverse engineer the binary," JFrog said in a statement.
.NET AoT Compilation is an optimization technique that lets you pre-compile applications to native code. Native AoT applications start faster and require less memory, and can also run on a machine without the .NET runtime installed.
“The attackers used typesquatting techniques to deploy a custom malicious payload that targeted the Exodus crypto wallet,” said Shachar Menashe, senior director at JFrog Security Research.
Downloading malicious packages to the platforms used by developers has already become commonplace. For example, shortly before the JFrog report, Phylum researchers discovered a malicious package named mathjs-min in the NPM service. The package contained a credential thief that grabbed passwords from the official Discord app, as well as web browsers such as Google Chrome, Brave, and Opera.
“Our investigation proves that no open source software repository is completely trustworthy, so security measures must be taken at every stage of the software development life cycle to ensure the security of the software supply chain,” JFrog concluded.