140+ Mastra npm Packages Compromised in Coordinated Supply Chain Attack

140+ Mastra npm Packages Compromised in Coordinated Supply Chain Attack
Socket uncovered a malicious npm supply chain campaign in which compromised @mastra/* packages were modified to pull in the typosquatted easy-day-js dependency, triggering a postinstall loader that downloaded a second-stage implant. The payload disabled TLS validation, persisted across Windows, macOS, and Linux, and stole browser history plus data from more than 160 cryptocurrency wallet browser extensions while exfiltrating to attacker infrastructure. #Mastra #easy-day-js #ehindero #sergey2016 #protocal.cjs

Keypoints

  • Socket detected a malicious npm campaign affecting compromised @mastra/* packages published on 2026-06-17 by the npm account ehindero.
  • The malicious packages were byte-for-byte identical to legitimate releases except for a new dependency on easy-day-js.
  • easy-day-js version 1.11.22 executed a postinstall hook that automatically ran during npm install.
  • The first-stage loader disabled TLS certificate validation, fetched a second-stage payload, executed it detached, and then deleted itself.
  • The second stage persisted on Windows, macOS, and Linux, collected browser history, inventoried more than 160 wallet extensions, and provided operator tasking capability.
  • @mastra/core was specifically highlighted as a high-risk package because it receives more than 918K weekly npm downloads, increasing the campaign’s blast radius.
  • Socket flagged the malicious dependency within minutes of publication and blocked installs for Socket customers before the install hook could run.

MITRE Techniques

  • [T1195.002] Compromise Software Supply Chain – The attacker compromised published npm packages and delivered malware through a transitive dependency (‘malicious npm supply chain campaign involving compromised @mastra/* packages’ and ‘pulled in that dependency, so npm install … runs setup.cjs automatically’).
  • [T1059.007] JavaScript – The payloads were implemented as Node.js/JavaScript scripts and executed by npm lifecycle hooks (‘node setup.cjs’ and ‘cross-platform Node.js tasking client’).
  • [T1068] Exploitation for Privilege Escalation – Not explicitly mentioned as privilege escalation; not applicable.
  • [T1105] Ingress Tool Transfer – The loader downloaded a second-stage payload from attacker-controlled infrastructure (‘fetch(url)’ and ‘pull stage 2’).
  • [T1573.001] Encrypted Channel – The loader and implant communicated over HTTPS/TLS to attacker infrastructure (‘fetch the second-stage payload from attacker-controlled infrastructure over TLS’ and ‘sends … over HTTPS POST’).
  • [T1041] Exfiltration Over C2 Channel – Collected data was sent back to attacker servers through the implant’s tasking/exfiltration channel (‘Collected data is exfiltrated to the operators’ command-and-control host’).
  • [T1053.003] Cron – Not explicitly used; Linux persistence was via systemd user service, not cron.
  • [T1547.001] Registry Run Keys / Startup Folder – Windows persistence was established via a Run key (‘Windows Run value NvmProtocal’).
  • [T1543.002] Systemd Service – Linux persistence used a systemd user unit (‘nvmconf.service’ and ‘ExecStart=…protocal.cjs’).
  • [T1547.013] PowerShell Profile – Not mentioned in the article; not applicable.
  • [T1547.007] Launch Agent – macOS persistence used a LaunchAgent (‘macOS LaunchAgent label com.nvm.protocal’).
  • [T1027] Obfuscated Files or Information – The loader was obfuscated with obfuscator.io (‘obfuscated with obfuscator.io’).
  • [T1112] Modify Registry – The Windows Run key was written for persistence (‘Windows Run value NvmProtocal’).
  • [T1562.013] Disable or Modify System Firewall – Not mentioned; no firewall modification described.
  • [T1057] Process Discovery – The implant collected running processes (‘installed applications, and running processes’).
  • [T1082] System Information Discovery – The implant collected hostname, architecture, platform, and user ID (‘hostname, architecture, platform, user ID’).
  • [T1217] Browser Session Cookie – Not directly recovered; the article says browser history was collected, not cookies.
  • [T1217 / T1213] Data from Local System – The implant copied browser History databases from Chrome, Edge, and Brave (‘copies each profile’s History database’).
  • [T1119] Automated Collection – The implant automatically inventoried wallet extensions and browser history during its tasking loop (‘carries a hardcoded list of 166 wallet browser-extension IDs’ and ‘copies each profile’s History database’).
  • [T1021] Remote Services – Not explicitly used for lateral movement; the article does not describe remote service abuse.
  • [T1070.004] File Deletion – The loader self-deleted to reduce traces (‘fs.rmSync(__filename, { force: true }); // self-delete’).
  • [T1090] Proxy – Not mentioned; no proxy behavior described.
  • [T1102] Web Service – The implant used web-based HTTPS endpoints for tasking and exfiltration (‘beacons to the operator’ and ‘over HTTPS POST’).

Indicators of Compromise

  • [IP address / HTTPS endpoint] C2 and download infrastructure – 23.254.164.92, 23.254.164.123:443
  • [Domain / hostnames] Attacker-hosted infrastructure – hwsrv-1327786.hostwindsdns.com, hwsrv-1327785.hostwindsdns.com
  • [URL path] Loader download and bot path – /update/49890878, /49890878
  • [File names] Dropped and loaded components – setup.cjs, protocal.cjs
  • [Persistence names] Cross-platform persistence artifacts – NvmProtocal, com.nvm.protocal, nvmconf.service, NodePackages
  • [Temporary artifacts] Loader markers and staging files – .pkg_history, .pkg_logs, browser-hist-*
  • [SHA-256 hashes] Known malicious files – b122a9873bedf145ae2a7fd024b5f309007dbb025149f4dc4ac3f7e4f32a36a4, cdec8b20338beb708b5be8d3d7a3041a35a8b0fb92f9186262f312d55ff82066, and 3 more hashes
  • [Package names / versions] Malicious dependency and affected packages – [email protected], @mastra/core, and 140+ other @mastra/* packages


Read more: https://socket.dev/blog/mastra-npm-packages-compromised