A new large scale supply chain attack has been observed targeting Azure developers with no less than 218 malicious NPM packages with the goal of stealing personal identifiable information.
“After manually inspecting some of these packages, it became apparent that this was a targeted attack against the entire @azure NPM scope, by an attacker that employed an automatic script to create accounts and upload malicious packages that cover the entirety of that scope,” JFrog researchers Andrey Polkovnychenko and Shachar Menashe said in a new report.
The entire list of malign packages was discovered by the NPM keepers approximately two days after publication. However, each package was downloaded an average 50 many times.
This attack is known as typosquatting. It occurs when malicious actors push fake packages with names that imitate legitimate libraries to public software registry like NPM and PyPI in the hopes of convincing users to install them.
In this specific case observed by the DevSecOps firm, the adversary is said to have created dozens of malicious counterparts with the same name as their existing @azure scope packages but without the scope name (e.g., @azure/core-tracing vs. core-tracing).
“The attacker is relying on the fact that some developers may erroneously omit the @azure prefix when installing a package,” the researchers said. For example, a user might run npm-install core-tracing accidentally, rather than the proper command: npm-install @azure/coretracing. “
Not only did the attack leverage a unique username to upload every single package to the repository to avoid raising suspicion, the malware-laced libraries also featured high version numbers (e.g., 99.10. 9), indicating an attempt to carry out a dependency confusion attack.
Should a developer unwittingly install one of these packages, it leads to the execution of a reconnaissance payload that’s designed to list directories as well as gather information about the user’s current working directory and IP addresses related to network interfaces and DNS servers, all of which is exfiltrated to a hardcoded remote server.
“Due the rapid rise in supply chain attacks through NPM package repositories and PyPI packages repositories it seems like more scrutiny should be applied and mitigations added.” the researchers stated.
“For example, adding a CAPTCHA mechanism on npm user creation would not allow attackers to easily create an arbitrary amount of users from which malicious packages could be uploaded, making attack identification easier. “