Mastra npm Supply Chain Attack: 144 Packages Compromised
On June 17, 2026, a software supply chain attack codenamed “easy-day-js” compromised 144 npm packages associated with the Mastra AI framework. Attackers hijacked a former contributor’s account to publish malicious versions that steal cryptocurrency wallet data from developers. The attack affects @mastra/core with 918,000 weekly downloads and highlights critical gaps in open-source package provenance verification.
What Happened: Mastra npm Scope Takeover
A single npm account (ehindero) mass-published over 140 malicious packages across the Mastra scope within an 88-minute window on June 17, 2026. Mastra is a popular open-source JavaScript and TypeScript framework for building AI applications. The attack represents one of the largest npm scope compromises targeting AI development infrastructure.
The infected packages themselves did not contain malicious code directly. Instead, attackers added a third-party dependency called “easy-day-js” that executed a cryptocurrency-stealing payload. The package was first published as a clean copy of the legitimate dayjs date library on June 16, 2026, at 7:05 a.m. UTC. Malicious changes were introduced on June 17, 2026, at 1:01 a.m. UTC.
The ehindero account was a legitimate former Mastra contributor whose scope access was never revoked. Consequently, attackers could publish packages using standard npm tokens rather than CI/CD pipelines. This bypassed Mastra’s established security practices.
Technical Details of the easy-day-js Supply Chain Attack
The attack exploited several weaknesses in npm package management and contributor access controls. The malicious easy-day-js library launched an obfuscated payload during the postinstall hook. This payload functioned as a dropper for a second-stage payload retrieved from attacker-controlled infrastructure.
Attack execution flow:
- The postinstall hook fired during package installation
- The payload disabled TLS certificate validation to avoid detection
- A second-stage payload was downloaded from 23.254.164[.]92
- The payload executed as a detached background process
- The loader erased itself to minimize forensic evidence
The final stage was a cross-platform information stealer capable of:
- Harvesting browser history from infected systems
- Stealing data from 160+ cryptocurrency wallet browser extensions
- Installing persistence mechanisms across Windows, macOS, and Linux
- Exfiltrating captured data to C2 server 23.254.164[.]123
Provenance Verification Bypass
Mastra normally ships releases from CI through npm’s trusted publisher flow. Each legitimate release carries SLSA provenance attestations. However, the attacker pushed malicious versions from a personal token and dropped the provenance. Mastra did not require provenance verification, so standard npm tokens could still publish without attestations.
Business and Operational Impact
The attack has significant implications for AI development infrastructure security. Any workstation, CI runner, or build environment that installed affected versions should be treated as potentially compromised.
Key impact metrics:
- 144 npm packages compromised in the @mastra/* namespace
- 918,000+ weekly downloads for @mastra/core alone
- Cryptocurrency wallet data at risk across 160+ extensions
- Cross-platform impact (Windows, macOS, Linux)
- Potential credential exposure requiring rotation
Organizations using Mastra in production environments face immediate remediation requirements. Furthermore, development teams must audit their build pipelines for signs of compromise. The attack demonstrates how a single compromised contributor account can cascade into widespread supply chain risk.
Mitigation and Recommendations
Organizations should take immediate action to assess and remediate potential compromise.
Immediate Actions for Defenders
- Audit package-lock.json and npm audit logs for any easy-day-js installations
- Roll back to known-safe versions of Mastra packages
- Rotate all credentials from potentially exposed development environments
- Scan affected hosts for artifacts linked to the campaign
- Review CI/CD logs for anomalous package installations
Long-Term Supply Chain Security
Development teams should implement provenance verification for npm packages. npm audit signatures and policies requiring SLSA attestations would have rejected every package in this campaign. Additionally, organizations should enforce least-privilege contributor access and regularly audit npm scope memberships.
Moreover, implementing dependency pinning and private registry proxies can reduce exposure to upstream compromises. Consequently, teams gain better control over what enters their build environment.
Bottom line: The Mastra npm compromise demonstrates that even well-maintained open-source projects remain vulnerable to supply chain attacks through stale contributor access. Organizations must verify package provenance and implement least-privilege access controls for publishing credentials.
Incident Summary
| Attack Name: | easy-day-js Supply Chain Attack |
| Affected Packages: | 144 @mastra/* npm packages |
| Core Package Impact: | @mastra/core (918K weekly downloads) |
| Malicious Dependency: | easy-day-js (cloned from dayjs) |
| Attack Vector: | Hijacked contributor account (ehindero) |
| Payload Type: | Cross-platform cryptocurrency stealer |
| C2 Infrastructure: | 23.254.164[.]92, 23.254.164[.]123 |
| Attack Window: | June 17, 2026 (88-minute campaign) |
| Patch Status: | npm reverted malicious versions |
References
- JFrog Security Research, “easy-day-js: Mastra npm Scope Takeover Supply Chain Attack,” JFrog, June 17, 2026, https://research.jfrog.com/post/easy-day-js/, accessed June 17, 2026
- SafeDep, “Mastra npm Scope Takeover Supply Chain Attack,” SafeDep Security Advisory, June 17, 2026, https://safedep.io/mastra-npm-scope-takeover-supply-chain-attack/, accessed June 17, 2026
- Socket, “144 Mastra npm Packages Compromised via Hijacked Contributor Account,” Socket.dev Blog, June 17, 2026, https://socket.dev/blog/mastra-npm-packages-compromised, accessed June 17, 2026
- StepSecurity, “Mastra npm Packages Compromised Using easy-day-js,” StepSecurity Blog, June 17, 2026, https://www.stepsecurity.io/blog/mastra-npm-packages-compromised-using-easy-day-js, accessed June 17, 2026