Skip to content

Be cautious, developers: Malicious software (malware) has been discovered in several popular Node Package Manager (NPM) packages. Here's what you should be aware of.

Over a dozen NPM packages, amassing a weekly user base of a million, have been manipulated to distribute malware.

Malware-laden NPM packages, getting over a million weekly installs, have fallen prey to cyber...
Malware-laden NPM packages, getting over a million weekly installs, have fallen prey to cyber intrusions.

In a startling revelation, around a dozen popular NPM packages, boasting a combined million weekly downloads, have been infiltrated to disseminate malicious software. These packages, used for installing libraries, managing dependencies, and more, are part of the Node Package Manager (NPM), the go-to package manager for JavaScript runtime environment, Node.js.

An alarming Remote Access Trojan (RAT) has surfaced, allowing attackers to tamper with systems by executing shell commands, capturing screenshots, and uploading files. The malicious actors could potentially engage in additional harmful activities such as cryptocurrency mining, data pilfering, and even service shutdowns.

According to Aikido Security's analysis, the same threat group behind the recent compromise of the popular package rand-user-agent seems to be behind this malicious campaign. The attackers' strategy remains consistently effective, delivering their RATs through compromised packages.

The newly discovered payload is almost identical to the one used in the rand-user-agent case, albeit with some minor modifications. It involves a new C2 server, two new commands, one that dumps system context and metadata, and another causing an external request to http://ip-api.com/json, returning the public IP information.

Aikido Security has released a list of affected packages, urging developers to conduct a thorough check. If you suspect your system may have installed any of these compromised packages, examine your firewall for outbound connections to these IPs:

  • 136.0.9[.]8
  • 85.239.62[.]36

Notably, the RAT may persist on the system by lodging itself in a file located at: %LOCALAPPDATA%\Programs\Python\Python3127, if you're using Windows. If you discover any files in this location, your system may have been compromised, and you should no longer trust its security.

To mitigate the risks associated with open source dependencies, Black Duck advises organizations to maintain accurate lists of dependencies used in projects. They also suggest using lock files to pin specific package versions, reducing unnecessary updates, and validating the provenance of packages by evaluating their sources and maintainers. Regularly checking for sudden updates, recently changed maintainers, or the introduction of suspicious post-install scripts is also advisable.

Lastly, it's essential to automate securing scanning within the CI/CD pipeline to analyze dependencies for potential security risks and scan source code for potentially malicious behavior or patterns. As the situation develops, it's crucial to stay updated on official communications from NPM or security firms for updates. By taking proactive measures, you can significantly reduce the exposure to these malicious supply chain attacks.

  1. In the realm of education-and-self-development, understanding the importance of cybersecurity in technology, particularly when working with open-source dependencies like Node Package Manager (NPM), is crucial for developers, given the recent string of compromised packages disseminating malicious software.
  2. To ensure the overall lifestyle and security of their systems, users should heed the advice offered by Black Duck, employing measures such as maintaining accurate dependency lists, using lock files, validating packages' provenance, and employing automated securing scanning within the CI/CD pipeline to mitigate risks associated with cybersecurity threats in the technology ecosystem.

Read also:

    Latest