Mastra NPM Packages Trojanized with Malicious Dependency Injection - 116 Packages Compromised
Mastra NPM Packages Trojanized with Malicious Dependency (TL-2026-0977), also tracked as Mastra Supply Chain Attack, is a critical-severity supply-chain compromise scored CVSS 9.8, first published 2026-06-17. It is attributed to Lazarus Group (North Korea) with high confidence, affects Mastra @mastra/core, maps to 33 MITRE ATT&CK techniques (T1005, T1027, T1030), and is covered by 9 detection rules and 28 indicators of compromise.
Key facts for TL-2026-0977
- Threat ID
- TL-2026-0977
- Also known as
- Mastra Supply Chain Attack, easy-day-js Injection, NPM Registry Compromise
- Severity
- CRITICAL
- CVSS
- 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H)
- Status
- ACTIVE
- Category
- SUPPLY_CHAIN
- First published
- 2026-06-17
- Last reviewed
- 2026-06-17
- Attribution
- Lazarus Group
- Attribution confidence
- HIGH
- Nation-state nexus
- North Korea
- Motivation
- financial
- Target sectors
- software-development, technology, artificial-intelligence, cloud-computing, fintech, health, government administration, defense
- Target regions
- Global, North America, Europe, Asia Pacific
- Detection rules
- 9
- Indicators of compromise
- 28
Malware and tooling in Mastra NPM Packages Trojanized with Malicious Dependency
Malware and tooling: easy-day-js, npm postinstall hook C2 channel, npm registry compromised account
On June 17, 2026, attackers compromised a maintainer account for the Mastra npm organization and republished 116 packages including the critical @mastra/core package (28M monthly downloads) by injecting a malicious dependency named easy-day-js. The attack targeted the widely-adopted open-source AI framework, affecting developer workstations, CI/CD pipelines, and build environments across the global developer community.
How Mastra NPM Packages Trojanized with Malicious Dependency works
A significant supply chain attack against the Mastra AI framework ecosystem occurred on June 17, 2026, when threat actors gained control of a maintainer account within the Mastra npm organization. Rather than directly modifying source code, the attackers employed a sophisticated dependency injection technique, introducing a malicious package named easy-day-js into 116 packages over a 27-minute window. The primary target was @mastra/core, a foundational component of the Mastra framework that receives hundreds of thousands of weekly downloads. With Mastra commanding 28 million monthly downloads across its ecosystem, this compromise potentially exposed the supply chain to thousands of organizations building AI applications. The malicious dependency was designed to execute during package installation and build processes, with potential impact spanning developer workstations, continuous integration and continuous deployment (CI/CD) pipelines, and production build environments. The compromise was facilitated through account takeover, likely via credential compromise, multi-factor authentication bypass, or social engineering. This incident demonstrates the critical vulnerability of open-source package managers to supply chain attacks and the need for enhanced dependency verification, package signing, and build environment isolation. The scale and sophistication of this attack—targeting the foundation of an AI development platform during a period of rapid AI adoption—suggests possible state-sponsored or organized cybercriminal involvement seeking to establish persistent access to downstream developers and their applications.
MITRE ATT&CK techniques used in TL-2026-0977
Collection
T1005 Data from Local System; T1115 Clipboard Data
Defense Evasion
T1027 Obfuscated Files or Information; T1036 Masquerading; T1070 Indicator Removal
Exfiltration
T1030 Data Transfer Size Limits; T1041 Exfiltration Over C2 Channel; T1567 Exfiltration Over Web Service
Execution
T1053 Scheduled Task/Job; T1059 Command and Scripting Interpreter; T1204 User Execution; T1569 System Services
Command and Control
T1071 Application Layer Protocol; T1090 Proxy; T1573 Encrypted Channel
Initial Access
T1078 Valid Accounts; T1195 Supply Chain Compromise; T1199 Trusted Relationship; T1566 Phishing
Persistence
T1098 Account Manipulation; T1136 Create Account; T1525 Implant Internal Image; T1556 Modify Authentication Process
Impact
T1485 Data Destruction; T1496 Resource Hijacking; T1499 Endpoint Denial of Service
Discovery
Credential Access
T1528 Steal Application Access Token
Lateral Movement
T1550 Use Alternate Authentication Material
credential-access
T1555 Credentials from Password Stores
initial-access
defense-impairment
T1578 Modify Cloud Compute Infrastructure
Resource Development
Affected products and versions in Mastra NPM Packages Trojanized with Malicious Dependency
- Mastra — @mastra/core
Vulnerable versions: All versions republished 2026-06-17 during 27-minute compromise window
Fixed in: Versions released after Mastra maintainers revoked compromised package versions - Mastra — @mastra/* (116 packages total)
Vulnerable versions: Versions with injected easy-day-js dependency published 2026-06-17
Fixed in: Patched versions released after compromise remediation - NPM Registry — easy-day-js (malicious package)
Vulnerable versions: All versions of the malicious easy-day-js package
Fixed in: Package removed from registry; all versions yanked
Remediation for Mastra NPM Packages Trojanized with Malicious Dependency
Patches
- Update @mastra/core to the remediated version released by Mastra maintainers after 2026-06-17
- Update all 116 affected Mastra packages to patched versions that remove the easy-day-js dependency
- Apply npm security advisories: npm audit fix --force (after verifying package authenticity)
Immediate actions
- Identify and quarantine all affected Mastra package versions installed between 2026-06-17 and the remediation date
- Review npm audit logs and package.lock files for easy-day-js dependency injection
- Isolate affected build systems and CI/CD pipelines from production networks
- Clear npm cache and node_modules directories: npm cache clean --force
- Check for indicators of unauthorized code execution or persistence mechanisms
- Revoke and rotate all credentials and secrets potentially exposed to compromised build environments
Workarounds
- Temporarily lock package versions to pre-compromise releases and whitelist specific approved versions
- Use npm's audit-level flag to fail builds on high-severity vulnerabilities: npm ci --audit-level=high
- Implement network-level blocking of known malicious C2 infrastructure associated with easy-day-js payload
- Use package.json lockfiles with integrity hashes and require hash verification before installation
Longer-term hardening
- Implement Software Bill of Materials (SBOM) generation and dependency scanning in all build pipelines
- Deploy npm package signature verification using npm's optional package signing features
- Enforce package manager authentication via access tokens with minimal scope and rotation policies
- Implement behavioral monitoring on build systems to detect anomalous dependency downloads or code execution
- Establish a package integrity verification process using multiple independent hash verification sources
- Require approval workflows for production dependency updates
- Implement sandboxed build environments with network isolation and limited outbound connectivity
- Monitor npm registry APIs for suspicious account activity patterns and maintainer changes
Weaknesses (CWE) in Mastra NPM Packages Trojanized with Malicious Dependency
CWE-494: Download of Code Without Integrity Check, CWE-506: Embedded Malicious Code, CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code, CWE-426: Untrusted Search Path
Timeline of Mastra NPM Packages Trojanized with Malicious Dependency
- npm and broader open-source community issue alerts to developers advising immediate action and package updates
- Wiz threat intelligence team publishes comprehensive analysis of Mastra supply chain compromise with technical details
- Mastra maintainers release patched versions of affected packages removing the easy-day-js dependency
- Mastra organization maintainer account password reset, MFA enabled/reinforced, and session tokens revoked
- Compromised packages and easy-day-js malicious dependency are yanked from npm registry; affected versions made unavailable for new installations
- Mastra maintainers and/or npm security team detect unusual package publishing activity and malicious dependency injection
- Attack propagates through supply chain affecting thousands of organizations and developers relying on Mastra framework for AI application development
- Malicious code from easy-day-js dependency executes during npm installation and/or build processes on developer workstations and CI/CD pipelines
- Malicious packages begin automatic distribution through npm installs; @mastra/core (hundreds of thousands weekly downloads) becomes vector for rapid compromise deployment
- @mastra/core and 115 other packages receive easy-day-js malicious dependency injection; packages propagate through npm registry to developer installations
- Attacker republishes 116 Mastra packages with injected easy-day-js malicious dependency over 27-minute window
- Threat actor compromises maintainer account for Mastra npm organization, likely through credential theft or MFA bypass
- Incident response teams across affected organizations begin identifying compromised build artifacts and potentially exposed systems
Sources cited for Mastra NPM Packages Trojanized with Malicious Dependency
- Wiz Threat Report: Mastra Packages Trojanized with Malicious Dependency
- Mastra Framework Official Repository
- NPM Security Advisory Database
- OWASP: Supply Chain Security
- CWE-494: Download of Code Without Integrity Check
- NPM Package Manager Security Best Practices
- NIST Software Supply Chain Security Guidance
- Mastra AI Framework Official Website
Threats related to Mastra NPM Packages Trojanized with Malicious Dependency
- Mastra npm Supply-Chain Compromise (@mastra/* namespace) via Typosquatted 'easy-day-js' — Multi-Stage Cross-Platform Infostealer
- Amazon: North Korea's Sapphire Sleet (Stardust Chollima/UNC1069) Compromises Axios, Debug, Chalk, and Typo-Crypto npm Packages in Supply-Chain Campaign
- Sapphire Sleet (DPRK) 'easy-day-js' Supply-Chain Compromise of 140+ Mastra npm Packages via Hijacked Maintainer Account
- Mastra npm Supply Chain Attack: 141 @mastra/* Packages Backdoored via easy-day-js Typosquat to Deploy Cross-Platform Infostealer/RAT
- Rust Supply Chain Attack on arrayref: Malicious Crate Versions with DPRK-Linked Backdoor
Detection coverage for TL-2026-0977
As of 2026-06-17, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-0977 across Splunk SPL, Microsoft KQL and Sigma, covering 28 indicator(s) of compromise. The whole corpus is readable without an account; a free account unlocks full detection query text in Splunk SPL, Microsoft KQL and Sigma; paid tiers add raw indicator values, correlation and the MCP server. Threadlinqs MCP server · View plans.