Microsoft Attributes Mastra NPM Supply Chain Attack to North Korean Actor Sapphire Sleet

North Korea's Sapphire Sleet Blamed for Mastra AI Framework Supply Chain Attack on NPM

CRITICAL
June 22, 2026
6m read
Supply Chain AttackThreat ActorMalware

Related Entities

Threat Actors

Sapphire Sleet APT38 BlueNoroffStardust Chollima

Organizations

Products & Tech

MastraNPM

Other

easy-day-jsAikidoOxSocketSonatypeStepSecurity

Full Report

Executive Summary

Microsoft has attributed a sophisticated software supply chain attack against the Mastra open-source project to Sapphire Sleet, a financially motivated North Korean state-sponsored threat actor. Also tracked as BlueNoroff and APT38, the group executed the attack on June 17, 2026, by compromising a developer's NPM account and publishing 141 malicious versions of packages associated with the Mastra AI framework. The malicious packages included a dependency designed to compromise developer machines, highlighting the increasing threat to the open-source ecosystem. Organizations using Mastra are urged to audit their dependencies, scan for compromise, and rotate all developer credentials.


Threat Overview

The attack targeted the Mastra project, a popular TypeScript framework for building AI agents that receives millions of weekly downloads. The threat actor, Sapphire Sleet, gained access to the 'ehindero' NPM maintainer account, which provided them with the necessary permissions to publish new versions of the official Mastra packages.

The attackers then published malicious updates for 141 packages. These updates were poisoned with a malicious dependency named easy-day-js, a deliberate typosquat of the widely used and legitimate dayjs library. This technique is designed to trick developers and automated systems into pulling in the malicious code. Microsoft's attribution to Sapphire Sleet was made with "high confidence" based on infrastructure and TTPs consistent with the group's previous financially motivated campaigns, such as the April 2026 Axios supply chain attack.


Technical Analysis

The attack chain demonstrates a clear understanding of software development pipelines and open-source repository weaknesses.

  1. Account Compromise: The initial vector was the compromise of the 'ehindero' NPM maintainer account. This likely occurred through phishing, credential stuffing, or malware. This action corresponds to T1078 - Valid Accounts.
  2. Staging: A day before the main attack, the threat actors published a 'clean' version of the malicious easy-day-js package from a separate, likely controlled account named 'sergey2016'. This may have been done to pre-populate the package in registries and bypass certain checks.
  3. Malicious Injection: On June 17, the attackers used the compromised 'ehindero' account to publish updates to 141 Mastra packages, adding easy-day-js as a dependency. This is a classic example of T1195.002 - Compromise Software Supply Chain.
  4. Payload Delivery: When developers updated their Mastra packages or new developers installed them, NPM would automatically download and install the malicious easy-day-js dependency, leading to code execution on the developer's machine. This falls under T1037 - Hijack Execution Flow.

The primary goal was to compromise developer systems, which are high-value targets as they often contain access tokens, API keys, SSH keys, and other secrets that provide access to sensitive cloud and corporate infrastructure.


Impact Assessment

The compromise of a popular AI framework like Mastra has cascading effects throughout the software ecosystem.

  • Direct Impact on Developers: Developers who installed the malicious packages likely had their systems compromised, leading to the theft of sensitive credentials and intellectual property.
  • Downstream Risk: Malicious code could be unintentionally bundled into applications built by the compromised developers, extending the supply chain attack to the end-users of those applications.
  • Erosion of Trust: Such attacks erode trust in the open-source ecosystem, making developers more hesitant to adopt new tools or update existing ones, which can paradoxically lead to other security risks from unpatched software.
  • Financial Motivation: Given Sapphire Sleet's history, the ultimate goal was likely financial gain, either through direct theft of cryptocurrency from developers or by using the access to compromise corporate financial systems.

IOCs — Directly from Articles

Type
file_name
Value
easy-day-js
Description
The name of the malicious typosquatted NPM package used as a dependency.
Type
other
Value
ehindero
Description
The compromised NPM maintainer account.
Type
other
Value
sergey2016
Description
The NPM account used to stage the malicious package.

Cyber Observables — Hunting Hints

Security teams should hunt for evidence of this compromise within their development environments:

Type
file_name
Value
package-lock.json
Description
Search for the string easy-day-js within this file across all projects.
Type
file_path
Value
node_modules/
Description
Check for the existence of an easy-day-js directory.
Type
command_line_pattern
Value
npm ls easy-day-js
Description
Run this command within project directories to see if the malicious package is part of the dependency tree.
Type
network_traffic_pattern
Value
Outbound connections from build agents
Description
Monitor for suspicious outbound network connections from CI/CD runners or developer machines to domains not associated with legitimate package registries or corporate resources.

Detection & Response

Organizations should focus on securing their software development lifecycle (SDLC).

  1. Dependency Scanning: Implement automated dependency scanning tools (like npm audit) in CI/CD pipelines to detect known malicious packages. Tools from Socket, Sonatype, and others offer advanced detection capabilities.
  2. Behavioral Analysis: Monitor developer endpoints and build servers for anomalous behavior, such as unexpected network connections, file modifications, or process execution.
  3. Incident Response: If a malicious package is detected, immediately isolate the affected systems, rotate all credentials (API keys, tokens, passwords) found on those systems, and perform a full security scan.

D3FEND Techniques:

  • File Analysis (D3-FA): Analyzing the contents of package.json and package-lock.json files for suspicious dependencies.
  • Software Update (D3-SU): While the attack vector was an update, a proper defensive process involves verifying updates before application. Using tools that vet package sources and signatures is a key part of a secure update process.

Mitigation

To prevent and mitigate similar supply chain attacks, organizations should:

  1. Enforce MFA on Code Repositories: Mandate phishing-resistant MFA for all developer accounts on platforms like NPM, GitHub, and GitLab.
  2. Use Scoped Tokens: Use fine-grained access tokens with limited permissions and short expiration times for CI/CD pipelines.
  3. Vet Dependencies: Before adopting a new open-source dependency, vet its maintainers, popularity, and security posture. Use tools that analyze package metadata and behavior.
  4. Implement npm-vet or similar tools: Use security tools that can detect typosquatting, dependency confusion, and other package-based threats.
  5. Educate Developers: Train developers on the risks of supply chain attacks and best practices for securing their accounts and development environments.

D3FEND Techniques:

Timeline of Events

1
June 16, 2026
A clean version of the malicious 'easy-day-js' package was published from the 'sergey2016' account.
2
June 17, 2026
Sapphire Sleet uses the compromised 'ehindero' NPM account to publish 141 malicious Mastra packages.
3
June 22, 2026
This article was published

MITRE ATT&CK Mitigations

Securing developer accounts on NPM and GitHub with MFA prevents account takeovers.

Mapped D3FEND Techniques:

Verifying the signatures of software packages before installation can help detect tampering.

Mapped D3FEND Techniques:

While the attack vector was an update, having a robust and secure software update process that includes verification is a key mitigation.

Mapped D3FEND Techniques:

Audit

M1047enterprise

Auditing and monitoring dependencies and build logs for signs of malicious activity.

Mapped D3FEND Techniques:

Timeline of Events

1
June 16, 2026

A clean version of the malicious 'easy-day-js' package was published from the 'sergey2016' account.

2
June 17, 2026

Sapphire Sleet uses the compromised 'ehindero' NPM account to publish 141 malicious Mastra packages.

Sources & References

Microsoft Attributes Mastra AI Supply Chain Attack to North Korea - Infosecurity Magazine
Infosecurity Magazine (infosecurity-magazine.com) June 22, 2026

Article Author

Jason Gomes

Jason Gomes

• Cybersecurity Practitioner

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.

Threat Intelligence & AnalysisSecurity Orchestration (SOAR/XSOAR)Incident Response & Digital ForensicsSecurity Operations Center (SOC)SIEM & Security AnalyticsCyber Fusion & Threat SharingSecurity Automation & IntegrationManaged Detection & Response (MDR)

Tags

Sapphire SleetAPT38NPMSupply Chain AttackMastraeasy-day-jsNorth KoreaMicrosoft

📢 Share This Article

Help others stay informed about cybersecurity threats

🎯 MITRE ATT&CK Mapped

Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.

🧠 Enriched & Analyzed

Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.

🛡️ Actionable Guidance

Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.

🔗 STIX Visualizer

Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.

Sigma Generator

Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.