Microsoft has attributed a supply chain attack targeting Mastra AI to Sapphire Sleet, a North Korean-linked threat actor also tracked as BlueNoroff. The campaign compromised more than 140 npm packages, the JavaScript package repository widely used by developers worldwide.
The attack leveraged the Mastra AI framework, a popular open-source library for building agentic AI applications. Attackers injected malicious code into multiple packages published under the Mastra namespace, potentially reaching thousands of downstream developers who installed these compromised dependencies.
Sapphire Sleet operates as a financially motivated threat group with documented ties to North Korean state interests. The group has previously targeted cryptocurrency exchanges, financial institutions, and technology companies. This marks an expansion of their tactics into the software supply chain, targeting developer infrastructure rather than end-user systems directly.
The compromised npm packages contained code designed to exfiltrate sensitive data from developer environments. Packages in the attack included tools for build processes and configuration management, giving attackers broad access to developer workstations and CI/CD pipelines. Organizations that downloaded affected versions between specific timeframes face exposure risks.
npm quickly removed the malicious packages following Microsoft's disclosure. Developers using Mastra AI should audit their dependency trees and upgrade to patched versions immediately. The attack underscores a persistent vulnerability in open-source ecosystems: attackers can poison widely-used libraries to compromise thousands of downstream projects with minimal effort.
Supply chain attacks have become a preferred vector for state-sponsored and criminal groups alike. Previous campaigns by other actors have demonstrated how compromised packages can remain undetected for months, affecting enterprises across multiple industries. Microsoft's attribution highlights North Korean actors' growing sophistication in targeting software development infrastructure.
Organizations should implement stricter dependency management practices, including package pinning, software composition analysis, and monitoring for suspicious packages. Security teams need visibility into
