Skip to content

npm's 'colors' Package Targeted in Malicious Typosquatting Attacks

Malicious packages, like 'colors-2.0.0' and 'colorsss', have exploited the 'colors' package. These attacks highlight the importance of vigilance in package management.

In this image there is an undefined object present in the middle.
In this image there is an undefined object present in the middle.

npm's 'colors' Package Targeted in Malicious Typosquatting Attacks

npm, the package manager for JavaScript, has faced a series of malicious typosquatting attacks. The 'colors' package, with 20 million weekly downloads, was targeted, leading to potential security risks for many open-source projects.

In November 2021, attackers attempted to exploit the 'colors' package by publishing malicious versions like 'colors-2.0.0' and 'colors-2.0'. These were later removed by npm. Some versions contained unobfuscated code with Discord Webhook URLs, confirming the findings.

Multiple malicious npm packages, including 'colorsss', 'grabbir', 'nocuzune', and 'wixdev2022-1', were published by unknown threat actors. They used the domain '62.113.122.13' to establish a TCP reverse shell access. These packages contained Discord token stealers and code that accessed browser 'leveldb' files. One package, 'wixdev2022-1', contained a Busybox Linux executable that connected to xhc[.]vg.

Last year, PyPI removed a malicious fork of 'mitmproxy', mitmproxy2, which had an artificially introduced code execution vulnerability. The 'colors' package was also sabotaged by its developer, causing it to print zalgo text incessantly.

These malicious packages are named to appear as newer versions of the official 'colors' library, confusing developers. Sonatype Repository Firewall users are protected from such malicious packages, as they are automatically blocked and quarantined. Sonatype's Repository Firewall has detected malicious npm packages, including 'colors2.0', 'colors-2.2.0', and 'colorsss'.

Read also:

Latest