Malicious Go Modules Deliver Disk-Wiping Linux Malware in Advanced Supply Chain Attack

jinia
By -


Cybersecurity researchers have uncovered three malicious Go modules that contain highly obfuscated code capable of downloading payloads that can irreversibly destroy a Linux system's primary disk, making it unbootable. These modules are part of an advanced supply chain attack targeting unsuspecting developers and Linux servers.


Malicious Go Modules Identified

The following Go modules have been flagged as malicious:


Despite their seemingly legitimate nature, these modules contain concealed code designed to fetch and execute remote payloads once deployed on Linux systems. According to Socket researcher Kush Pandya, the modules specifically target Linux systems and retrieve destructive payloads through the wget utility.


The Destructive Payload: Overwriting Linux Disks

Once activated, the payload executes a malicious shell script that overwrites the entire primary disk (/dev/sda) with zeros. This process effectively wipes all data and makes the system unbootable, rendering it completely inaccessible. The data destruction is so complete that no recovery tool or forensic method can retrieve the erased data, making this attack highly effective and permanent.


“This destructive method ensures no data recovery tool or forensic process can restore the data, as it directly and irreversibly overwrites it,” said Pandya.


A Growing Threat in Supply Chain Attacks

This attack highlights the growing danger of supply chain compromises in the software development lifecycle. Even trusted repositories like Go modules can be weaponized, turning legitimate code into a devastating threat for unsuspecting developers.


Additionally, recent findings show multiple malicious npm packages targeting cryptocurrency wallets. These packages are designed to steal mnemonic seed phrases, private keys, and sensitive data. Packages such as crypto-encrypt-ts and oauth2-paypal have been identified by security firms Socket, Sonatype, and Fortinet.


In a similar vein, malicious Python packages have been discovered in the Python Package Index (PyPI), with two prominent packages, web3x and herewalletbot, designed to steal mnemonic seed phrases. These packages have collectively been downloaded over 6,800 times since their release in 2024.


PyPI Packages and Data Exfiltration

In addition to cryptocurrency-targeting packages, other malicious PyPI modules, such as cfc-bsb and coffin-codes, were found leveraging Gmail's SMTP servers and WebSockets for data exfiltration and remote command execution. These packages evade detection by utilizing legitimate services like Gmail, which are unlikely to be flagged by endpoint protection systems. Notably, cfc-bsb deviates by incorporating WebSocket logic for remote access, making it a distinct threat.


How Attackers Evade Detection

The use of Gmail’s trusted domain, smtp.gmail[.]com, enables attackers to bypass corporate proxies and endpoint protection systems, making the attack stealthy and reliable. Once compromised, the attacker can use a WebSocket connection for bidirectional communication, allowing them to execute remote commands and exfiltrate data.


Mitigating Supply Chain Attack Risks

To mitigate the risk of such sophisticated supply chain attacks, developers should:

  • Verify package authenticity by checking the publisher's history and GitHub repository links.
  • Audit dependencies regularly to ensure no malicious code is introduced into the project.
  • Enforce strict access controls on private keys and other sensitive resources.


Additionally, developers should remain vigilant for unusual outbound connections, particularly SMTP traffic, as attackers can exploit trusted services like Gmail to steal valuable data.


"Do not trust a package solely because it has existed for a few years without being taken down," cautioned Socket researcher Olivia Brown. "Regular audits and package verification are key to maintaining the security of your development environment."


Conclusion

This advanced supply chain attack is a clear reminder of the need for robust cybersecurity measures to protect the integrity of development environments and prevent severe data breaches. Always stay alert and adopt secure coding practices to safeguard against these evolving threats.