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

Summary
StepSecurity reports that an attacker used compromised Mastra organization credentials to add the easy-day-js typosquat to 140+ packages; its postinstall dropper fetched a second-stage payload. A controlled Harden Runner test blocked the download; credential theft was a
Key points
- StepSecurity reports that on June 17, 2026, an attacker used compromised @mastra organization credentials to republish more than 140 packages with easy-day-js added as a production dependency.
- The clean [email protected] bait version was followed by malicious [email protected]; the ^1.11.21 dependency range could resolve to the malicious version during installation.
- Version 1.11.22 included an obfuscated setup.cjs file and a postinstall hook that ran it automatically.
- The dropper disabled TLS certificate verification, wrote installation markers to temporary files, fetched a second-stage payload, launched it as a detached process, and deleted itself.
- The article says the second-stage payload was not embedded in the package; environment-variable harvesting and exfiltration were described as likely, not confirmed.
- In StepSecurity's controlled GitHub Actions test, Harden Runner blocked the payload download, so the second stage did not run and credential exfiltration was not observed in that test.
- StepSecurity says the payload-download IP was added to its Harden Runner Global Block List.
Article Details
- Attack Vectors
- The attacker used compromised @mastra organization credentials to publish 140+ packages with easy-day-js added as a production dependency.
- The [email protected] typosquat used a postinstall hook to run an obfuscated setup.cjs dropper during npm installation.
- The dropper attempted to download a stage-two payload from an attacker-controlled URL, then launch it as a detached background process.
- The package impersonated dayjs by copying its metadata; the clean [email protected] bait version was dependency-pinned with a range that resolved to the later malicious version.
- Defensive Notes
- Treat installations of affected @mastra packages published on 2026-06-17 as potentially compromised, according to the article.
- The article recommends restricting workflow outbound connections with an allowlist; Harden Runner block mode prevented the observed payload download.
- Check easy-day-js package versions and tarballs for the malicious 1.11.22 release, the setup.cjs file, and its postinstall hook.
- The article says the dropper sets NODE_TLS_REJECT_UNAUTHORIZED=0, writes markers under the temporary directory, launches a detached process, and deletes setup.cjs; account for these behaviors during investigation.
Indicators of compromise
| Type | Indicator | Context |
|---|---|---|
sergey2016@tutamail[.]com | Email associated in the article with the attacker account that published the malicious easy-day-js versions. | |
| IPV4 | 23[.]254[.]164[.]123 | Stage-two command-and-control address passed to the detached payload; the article says it was not contacted in the controlled test. |
| IPV4 | 23[.]254[.]164[.]92 | Attacker-controlled stage-one server used to serve the stage-two payload on port 8000. |
| URL | hxxps[:]//23[.]254[.]164[.]92:8000/update/49890878 | Specific attacker-controlled URL used to download the stage-two payload; the article reports the request was blocked during testing. |
MITRE ATT&CK
T1027 · Obfuscated Files or InformationThe dropper used custom-alphabet Base64 encoding, rotated string arrays, an integrity check, and an XOR-encoded marker to obfuscate its contents.T1036.005 · Match Legitimate Resource Name or LocationThe easy-day-js package copied dayjs metadata and mirrored its version numbering to appear legitimate.T1059.007 · JavaScriptThe easy-day-js postinstall hook ran setup.cjs through Node.js during package installation.T1070.004 · File DeletionAfter execution, the dropper attempted to delete setup.cjs from the package tree.T1071.001 · Web ProtocolsThe dropper attempted to retrieve the second-stage payload using an HTTPS URL.T1105 · Ingress Tool TransferThe dropper attempted to download a second-stage payload from the specified server; the article reports the request was blocked in its controlled test.T1195.002 · Compromise Software Supply ChainThe attacker used compromised @mastra organization credentials to add a malicious dependency to 140+ published packages.
Threat Actors
Vendors
Products
dayjsacross 140+ packages in the Mastra AI framework ecosystem. easy-day-js is a typosquat of the popular dayjs date library, and its latest version contained an obfuscated postinstall dropper that downloaded and ran aHarden-RunnerRuntime Analysis Using Harden RunnerMastraOn June 17, 2026, an attacker compromised the @mastra npm organization and quietly added easy-day-js as a dependency across 140+ packages in the Mastra AI framework ecosystem. easy-day-js is a typosquat of the popularnpmOn June 17, 2026, an attacker compromised the @mastra npm organization and quietly added easy-day-js as a dependency across 140+ packages in the Mastra AI framework ecosystem. easy-day-js is a typosquat of the popular
