# 144 Mastra npm packages compromised in major software supply chain attack

> Source: <https://dev.to/davekurian/144-mastra-npm-packages-compromised-in-major-software-supply-chain-attack-5fif>
> Published: 2026-06-17 13:06:02+00:00

Mastra npm Packages Compromised in easy-day-js Supply Chain Attack: What Developers Must Know

The Mastra npm packages compromise is one of the largest targeted software supply chain attacks seen in the JavaScript ecosystem to date. In June 2026, attackers exploited a hijacked npm contributor account — specifically `ehindero`

— and mass-published malicious versions of 144 packages under the @mastra namespace. As Mastra serves as a popular open-source JavaScript and TypeScript framework for artificial intelligence (AI) applications, the risks extend deep into the ecosystem powering next-generation AI products. Developers and security teams using Mastra now face urgent questions about code integrity, dependency trust, and ongoing protection against similar npm security breaches in 2024 and beyond.

A single compromised npm contributor account (`ehindero`

) was used to mass-publish malicious updates to 144 packages in the @mastra namespace, in an incident codenamed the easy-day-js attack. Security researchers from JFrog, SafeDep, Socket, and StepSecurity jointly uncovered and named the breach.

According to reporting from JFrog, SafeDep, Socket, and StepSecurity, the attacker gained access to the `ehindero`

npm account — likely through credential theft or phishing (method not publicly detailed) — and then published a sudden wave of package updates under @mastra. The targeted packages belong to Mastra, which is widely adopted for AI application development in both JavaScript and TypeScript environments.

The easy-day-js supply chain attack is characterized by malicious code inserted directly into trusted open-source libraries. By using account-level permissions, attackers bypassed normal review, causing all downstream consumers of the affected packages to automatically pull poisoned logic on install or upgrade.

The scale is what sets this incident apart: 144 npm packages impacted in one sweep, all via a single contributor account. The unified findings from the four security firms above confirm the method — hijack, poison, publish — and the scope: any project with direct or indirect dependencies on @mastra/* may have received compromised code.

[[DIAGRAM: project dependency flow — 'trusted' Mastra → hijacked contributor → poisoned update → downstream AI app]]

The easy-day-js incident is a textbook example of a modern npm supply chain attack, where the public trust model of open-source dependencies becomes the primary attack surface — not a technical exploit, but an abuse of access.

In this scenario, the attacker’s vector was to hijack the keys to the kingdom: the `ehindero`

npm account with publish rights to @mastra namespace packages. With control over this account, the attacker unleashed mass updates, each embedding malicious payloads into legitimate distribution channels. This method sidesteps technological barriers like code review or automated scanning if those controls aren’t enabled upstream — a single trusted publisher can poison a wide swath of dependencies at speed.

The mechanics are simple, but the impact is complex:

``` js
// Example: AI app with implicit @mastra dependency
import { Model } from "@mastra/core";     // If @mastra/core is compromised...
// Downstream AI logic may inadvertently run malicious code
```

Because most AI apps rapidly prototype using third-party frameworks, the ease of installing from npm (`npm install @mastra/core`

) means an attacker can silently swap trusted modules with poisoned code that runs in production workflows, CI/CD pipelines, or cloud environments.

The easy-day-js attack underscores that npm package hijacking is not theoretical. Compromise at the contributor level cascades out to all downstream consumers, making it especially dangerous for high-use frameworks like Mastra powering AI workloads. Unchecked, this supply-chain manipulation can enable credential exfiltration, code execution, or data tampering at scale.

The compromise of @mastra npm packages exposes developers and organizations to a broad set of risks: from the integrity of application logic to the leaking of sensitive data handled by AI models built on Mastra.

First, the fundamental risk is that AI apps using Mastra as a dependency could import and execute untrusted, malicious code — without any visible red flags in their own source tree. That hijacked code could perform actions including but not limited to:

Once the malicious code lands in the supply chain, dependency chain contamination becomes a real possibility. Any package further down the line (`@mastra/utils`

, `@mastra/ai`

, etc.) built atop core Mastra modules might inherit these exploits, amplifying the blast radius. This creates a downstream effect — not just those directly depending on the poisoned packages, but anyone deep in the dependency tree is at risk.

Security researchers (per JFrog, SafeDep, Socket, StepSecurity) universally recommend immediate, automated auditing of dependency trees and removal of any packages published by the affected contributor during the compromise window. Manual audits will not scale for an event of this magnitude.

For developers, the key implication is clear: trust in the open-source ecosystem is brittle at the account-level. If the AI logic, authentication flows, or infrastructure glue in your project touches @mastra, you must review, quarantine, or replace those packages now.

[[COMPARE: codebase before and after dependency audit — with/without poisoned Mastra packages]]

To immediately reduce exposure from the Mastra npm compromise, developers need to verify project dependencies for authenticity, integrity, and clean provenance. Here’s a step-by-step mitigation flow using npm’s native tools and industry advisories:

**1. Audit dependencies for @mastra packages and affected publish window.**

```
npm ls | grep "@mastra/"
# or, for all indirect dependencies:
npm ls --all | grep "@mastra/"
```

Cross-reference any @mastra package versions in use with advisories or incident reports from JFrog, SafeDep, Socket, and StepSecurity.

**2. Use third-party scanners and advisories.**

```
npm audit              # Built-in scan for known vulnerabilities
node --inspect script.js    # Run in debug mode if you suspect runtime exploits
```

**3. Remove or lock to safe versions.**

If a package is listed as compromised, immediately remove or roll back to a known-safe version. Prefer explicit version pinning over wildcard or floating semvers:

```
// package.json
"dependencies": {
  "@mastra/core": "1.2.3"        // Pin to a vetted version
}
```

**4. Monitor contributor permissions and rotate credentials.**

Beyond dependency hygiene, managing publish rights is critical:

**5. Set up continuous monitoring and alerts.**

Implement continuous monitoring scripts or integrate with advisory feeds. Many supply chain scanning services offer webhooks, allowing for near-real-time alerts when new threats are discovered.

**Best practices** for npm and open-source security, permanently relevant:

For more, see [How to Secure npm Packages and Avoid Supply Chain Attacks](https://dev.to/docs/security/npm-supply-chain) and [Best Practices for Managing Open-Source Contributor Accounts](https://dev.to/docs/security/contributor-accounts).

The easy-day-js Mastra compromise cements the reality that npm supply chain attacks are increasing in frequency and sophistication, aided by the open nature of modern JavaScript package registries.

The event demonstrates that all it takes is one credential failure — at the contributor level — to potentially compromise thousands of downstream projects, especially when trusted frameworks like Mastra are targeted. This is not an isolated occurrence, but the latest in a series of npm security breaches in 2024, pushing maintainers and registries toward more aggressive interventions.

Security researchers now call for:

For the Mastra and npm communities, the way forward includes investing in layered review, dependency mapping, and tighter deploy processes. As supply chain risk becomes an existential threat for AI-driven, highly composable JavaScript stacks, organizations must adapt both technically and operationally to secure every link in the chain.

For a deeper dive into JavaScript supply chain attack tolerance, see [Understanding JavaScript Framework Security Risks](https://dev.to/docs/security/js-framework-risks).

[[CONCEPT: supply chain trust decay — a single compromised account poisons the whole tree]]

The Mastra npm packages compromise, enabled by a hijacked contributor account and the easy-day-js supply chain attack, is a stark warning: no JavaScript framework, however reputable, is immune from credential-driven threats. AI app builders and security teams cannot afford to ignore their dependency tree’s integrity. Regular audits, strict publisher controls, and vigilant monitoring are now baseline requirements—not optional extras. The npm ecosystem’s move into AI workloads only raises the stakes. Developers: check your dependencies today, not tomorrow.
