Intelligence
criticalSupply ChainActive

North Korean Sapphire Sleet targets npm ecosystem with Mastra AI supply chain compromise affecting 140+ packages

Microsoft attributed a compromise of over 140 npm packages to North Korean threat actor Sapphire Sleet, leveraging the Mastra AI project as an entry point. This represents a high-impact supply chain attack with potential for widespread malware distribution across the JavaScript ecosystem.

S
Sebastion

Affected

npm registryMastra AIJavaScript applications using affected npm packages

Sapphire Sleet's compromise of the Mastra AI npm packages represents a sophisticated supply chain attack that exploits the inherent trust relationships within open-source dependency chains. The attackers gained control over a popular AI framework and used it to distribute malicious code across 140+ downstream packages, potentially affecting thousands of applications that depend on these libraries. This scale indicates either credential compromise of maintainers, a successful social engineering campaign, or exploitation of npm's access control mechanisms.

The technical mechanism likely involved either publishing malicious versions of legitimate packages or injecting code into the build pipeline. The breadth of affected packages suggests the compromise extended beyond a single maintainer account, pointing to either a coordinated effort against multiple developers or a more systemic vulnerability in how npm handles package ownership and publishing rights. Organisations running automated dependency updates could have automatically pulled compromised code into production without human review.

Defenders operating JavaScript applications should immediately audit all npm dependencies against the affected package list, check deployment logs for installations of compromised versions, and scan for indicators of compromise associated with Sapphire Sleet's known attack patterns. Pinning specific package versions rather than accepting automatic updates becomes critical mitigation. Development teams should implement code review requirements for all dependency upgrades, even patch versions.

This attack underscores that state-sponsored actors increasingly view open-source ecosystems as attack surfaces equivalent to traditional software vendors. The JavaScript ecosystem's scale, global distribution, and reliance on automated tooling make it an attractive target. npm's current model of near-instantaneous package availability without pre-publication security scanning creates a structural vulnerability that defenders cannot fully mitigate at the endpoint level.

The attribution to North Korea specifically signals this was likely reconnaissance or preparation for follow-on attacks against specific target organisations. Sapphire Sleet typically pursues financially motivated objectives, suggesting either espionage against companies using these frameworks or staged access for future monetisation attacks. Organisations in finance, defence, and critical infrastructure using JavaScript applications should assume heightened targeting risk.