Soon after discovering the hijack, developers (opens in new tab) also spotted another popular component - rc - also being affected. The rc library is even more popular than coa, getting some 14 million downloads a week.
One of the things that raised suspicions among developers (opens in new tab) was the fact that the last stable coa version - 2.0.2 - was released in December 2018. Then, all of a sudden, five versions began appearing on npm, all in a matter of hours, “breaking React packages that depend on coa”.
"I'm not sure why or what happened but 10 minutes ago there was a release (even though the last change on GitHub was in 2018). Whatever this release did, it broke the internet," said Roberto Wesley Overdijk, a React developer (opens in new tab).
Last month, a popular npm library ua-parser-js, used by many of the world’s largest websites and tech companies, was also hijacked, and with the malicious code embedded in both instances being virtually identical, it led Bleeping Computer to conclude that the malicious actor behind these incidents is probably the same.
The publication’s analysts are saying the malware is likely Danabot, a password-stealing Trojan for Windows (opens in new tab). It is capable of stealing passwords (opens in new tab) from all popular website browsers, FTP clients, and various applications, as well as stored credit cards (opens in new tab). It can take screenshots of active screens, and log keystrokes.
The malicious versions have since been removed, but all coa and rc library users are advised to check their projects for malicious software.