Malicious npm Packages Pose as PostCSS Tools to Deliver Windows RAT
Malicious npm packages have been discovered that pose as PostCSS tools to deliver a Windows-based remote access trojan. The packages were published by an npm user named 'abdrizak' and have been downloaded over 1,000 times.
Intelligence analysis by Llama 3.3 70B

The malicious packages are designed to appear as legitimate PostCSS tools, but actually contain a JavaScript dropper that writes a PowerShell script to disk and executes it, leading to the deployment of a Windows malware.
Imagine you're a developer and you need a tool to help you with your work. You search for it online and find a package that seems to do what you need. But, what if that package is actually a bad guy in disguise? That's what happened with some packages on npm, a platform where developers share tools. The bad packages looked like they were from a trusted source, but they actually contained malware that could harm your computer.
Analysis
Malicious Packages Discovered
The malicious npm packages, including 'aes-decode-runner-pro', 'postcss-minify-selector', and 'postcss-minify-selector-parser', were published by an npm user named 'abdrizak' over the past month. These packages have been downloaded over 1,000 times and are still available for download from npm.
The packages appear to be legitimate PostCSS tools, but actually contain a JavaScript dropper that writes a PowerShell script to disk and executes it. This script then acts as a downloader for a next-stage payload retrieved from an external server, which is a ZIP archive containing a Visual Basic Script file and a Python runtime.
Attack Chain and Malware Capabilities
The attack chain leads to the deployment of a Windows malware that is equipped to gather host information, siphon credentials from Google Chrome, collect data from Chrome extensions, run shell commands, and download/upload files to and from a command-and-control server. The malware uses a set of Python native extension modules to realize these features, including 'config.pyd', 'api.pyd', 'audiodriver.pyd', 'command.pyd', 'auto.pyd', and 'util.pyd'.
Broader Implications and Similar Attacks
This discovery coincides with other campaigns targeting the npm and TypeScript ecosystem, including a malicious package named 'apintergrationpost' that delivers a full-featured Linux RAT, and a cluster of five packages that delivers a dropper binary on Windows hosts. These attacks highlight the risk of supply chain attacks in the npm ecosystem and the importance of treating lookalike build dependencies as potential delivery mechanisms for malware.
Mitigation and Recommendations
Users who have installed any of the malicious packages are advised to remove them immediately, remove any artifacts created by them, and rotate credentials from impacted developer machines. Developers should also be cautious when installing packages from unknown sources and should verify the authenticity of packages before installing them. Additionally, developers should keep their dependencies up to date and monitor their package installations for any suspicious activity.
Key points
- Malicious npm packages pose as PostCSS tools to deliver Windows RAT
- Packages were published by an npm user named 'abdrizak' and have been downloaded over 1,000 times
- Attack chain leads to deployment of Windows malware with various capabilities
- Similar attacks have been discovered targeting the npm and TypeScript ecosystem
The discovery of these malicious packages highlights the importance of vigilance in the developer community. By being aware of the risks and taking steps to mitigate them, developers can protect themselves and their users from malware and other security threats. Additionally, the npm community can work together to improve the security of the platform and prevent similar attacks in the future.
The discovery of these malicious packages is a reminder of the risks associated with relying on third-party dependencies. If left unchecked, these types of attacks could lead to widespread compromise of developer machines and the theft of sensitive information. Furthermore, the use of legitimate-looking packages to deliver malware could erode trust in the npm ecosystem and make it more difficult for developers to know what packages are safe to use.



