Microsoft links Mastra AI supply chain attack to North Korean hackers
Microsoft attributes Mastra AI supply chain attack to North Korean hacking group Sapphire Sleet. The attack compromised over 140 npm packages.
Intelligence analysis by Llama 3.3 70B

The attack began with the compromise of an npm maintainer account, which was used to publish malicious package updates. These updates injected a malicious dependency that executed a post-install hook, deploying malware on developers' devices.
Imagine you're building a house with blocks. Each block is like a piece of software, and you need to make sure each block is safe and secure before you add it to your house. But sometimes, bad people can sneak into the block factory and add bad things to the blocks. This is like what happened in the Mastra AI supply chain attack, where bad people added malicious code to software blocks, which were then used by developers to build their applications.
Analysis
Introduction to Supply Chain Attacks
The Mastra AI supply chain attack is a recent example of the growing threat of supply chain attacks in the software development industry. These attacks involve the compromise of third-party components or dependencies, which are then used to inject malicious code into a target system. In this case, the attackers compromised an npm maintainer account and used it to publish malicious updates for over 140 packages in the @mastra scope.
The malicious updates injected a dependency named "easy-day-js", which is a typosquat of the legitimate dayjs JavaScript library. When the compromised packages were installed, the malicious dependency executed a post-install hook that deployed a malware dropper on developers' devices. This malware was designed to steal sensitive credentials, API keys, authentication tokens, and cryptocurrency wallets.
The Attackers' Tactics, Techniques, and Procedures (TTPs)
According to Microsoft, the attackers' TTPs are consistent with those of the North Korean hacking group Sapphire Sleet. The group is known for its cryptocurrency theft campaigns, malicious browser extensions, and software supply chain compromises. The attackers used a PowerShell backdoor, tradecraft, and C2 infrastructure that have been used in previous campaigns.
The malware used in the attack was a cross-platform information stealer that targeted Windows, Linux, and macOS systems. It collected information about the host, browser histories, installed applications, and running processes, and checked for the presence of 166 cryptocurrency wallet browser extensions. The malware also used different persistence methods depending on the operating system, including Windows Registry Run keys, macOS LaunchAgents, and Linux systemd services.
Implications and Mitigations
The Mastra AI supply chain attack highlights the importance of securing the software supply chain. Developers and organizations must be vigilant in monitoring their dependencies and ensuring that they are free from malicious code. This can be achieved through regular security audits, vulnerability testing, and the use of secure coding practices.
In addition, organizations must have incident response plans in place to quickly respond to supply chain attacks. This includes having a team of security experts who can quickly identify and contain the attack, as well as having procedures in place for notifying affected parties and coordinating with law enforcement.
The attack also highlights the need for greater transparency and accountability in the software development industry. Developers and organizations must be willing to disclose vulnerabilities and incidents in a timely and transparent manner, and must be held accountable for their role in securing the software supply chain.
Key points
- Microsoft attributes Mastra AI supply chain attack to North Korean hacking group Sapphire Sleet
- The attack compromised over 140 npm packages
- The attackers used a malicious dependency to execute a post-install hook and deploy malware on developers' devices
- The malware was designed to steal sensitive credentials and cryptocurrency wallets
The discovery of the Mastra AI supply chain attack and the attribution of the attack to North Korean hackers can help to raise awareness of the risks of supply chain attacks and the importance of securing the software supply chain. This can lead to increased investment in security measures, such as regular security audits and vulnerability testing, and the development of more secure coding practices.
The Mastra AI supply chain attack highlights the risks of relying on third-party components and dependencies in software development. If left unaddressed, these risks can lead to further compromises and attacks, which can have serious consequences for individuals and organizations. The attack also highlights the need for greater transparency and accountability in the software development industry, which can be a challenge to achieve.



