Skip to content
supplychainattack.orgSupply chain attack incident catalog
activecritical

Mastra npm Supply Chain Attack: 140+ Packages Backdoored via easy-day-js Typosquat

On June 17, 2026, an attacker compromised the @mastra npm organization and injected easy-day-js, a typosquat of the popular dayjs library, as a dependency across 140+ packages. The malicious package contained an obfuscated postinstall dropper that downloaded and executed a second-stage payload from attacker-controlled servers before self-deleting. The affected packages had a combined weekly download count exceeding 1.1 million.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
140+ npm packages in the Mastra AI framework ecosystem with combined weekly downloads exceeding 1.1 million
Ecosystems
Attack vectors
Affected entities
  • @mastra (organization)140+ packages compromised; easy-day-js added as dependency
  • easy-day-jsTyposquat of dayjs; contained obfuscated postinstall dropper

On June 17, 2026, the @mastra npm organization was compromised, and an attacker added easy-day-js as a dependency across 140+ packages within the Mastra AI framework ecosystem. easy-day-js is a typosquat of the legitimate dayjs date library, designed to deceive developers into installing the malicious package.

The malicious easy-day-js package contained an obfuscated postinstall script that executed during installation. This script downloaded and ran a second-stage payload from attacker-controlled servers, then deleted itself to remove evidence of the compromise.

The attack had significant reach: the affected @mastra packages combined for weekly download counts exceeding 1.1 million. Any installation of affected @mastra packages on June 17, 2026 or later would have resulted in execution of the malicious payload.

The incident represents a multi-vector supply chain attack combining account/organization compromise with typosquatting and automated malware delivery via postinstall hooks.

Indicators of compromise

Packages
  • easy-day-js

Remediation

  • Immediately audit npm audit logs and package-lock.json files for installations of @mastra packages and easy-day-js on or after June 17, 2026
  • Treat any environment where @mastra packages were installed as potentially compromised; perform forensic analysis for signs of second-stage payload execution
  • Remove all @mastra packages and easy-day-js from affected environments
  • Rotate all credentials, API keys, and secrets that may have been exposed on compromised systems
  • Monitor for indicators of compromise from the attacker-controlled servers mentioned in the dropper
  • Update to patched versions of @mastra packages once the organization regains control and publishes security updates
  • Implement stricter npm package verification and dependency pinning practices
  • Enable npm 2FA and organization-level access controls to prevent account takeover

Sources

  1. Mastra npm Supply Chain Attack: 140+ Packages Backdoored via easy-day-js Typosquat · StepSecurity

Cite this entry

"Mastra npm Supply Chain Attack: 140+ Packages Backdoored via easy-day-js Typosquat." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed June 17, 2026; last updated June 20, 2026. https://supplychainattack.org/incident/mastra-npm-supply-chain-attack-140-packages-backdoored-via-easy-day-js-typosquat-o3zznw

Suggest a correction

Found an error or have a newer source? Corrections to factual errors take priority over new entries.

  1. containedcritical

    Malicious code in @types-beta/sdk (npm)

    The npm package @types-beta/sdk (versions 0.1.0–0.1.3) is a supply-chain dropper that impersonates the trusted @types/DefinitelyTyped namespace. It bundles a Windows executable (nanocache.exe) that executes at import time, establishing a persistent remote-access agent with command-and-control capabilities.

    npmCompromised packageTyposquatting
  2. resolvedcritical

    Malicious code in @dexwilt/node-fetch (npm)

    The @dexwilt/node-fetch npm package is a typosquatting attack impersonating the legitimate node-fetch project. Its CommonJS entry point contains obfuscated malicious code that downloads and executes a remote binary payload.

    npmCompromised packageTyposquatting
  3. containedcritical

    Malicious code in redis-type-xyz (npm)

    redis-type-xyz is a malicious npm package that impersonates Redis OM by copying its metadata while substituting a known-malicious ulid-xyz dependency. Installation triggers a postinstall hook that establishes C2 communication and enables system compromise including persistence and arbitrary code execution.

    npmCompromised packageTyposquattingDependency confusion
  4. resolvedhigh

    Amazon links Debug, Chalk NPM supply-chain attacks to North Korean hackers

    Amazon attributed multiple high-profile npm supply chain attacks targeting the Debug and Chalk packages to North Korean threat actors. The incidents involved compromised packages in the npm ecosystem with significant downstream impact.

    Lazarus GroupnpmCompromised packageMalicious maintainer