the entire @mastra npm scope got hijacked last night with 141 packages including @mastra/core
Source Reddit Malware
Discussion
The entire @mastra npm scope was hijacked, affecting 141 packages including @mastra/core. The attacker did not modify the original source code but added a malicious dependency named easy-day-js, a seemingly benign dayjs clone. The attack exploited semantic versioning by specifying a dependency version range (^1.11.21) while the latest tag pointed to a newer version (1.11.22) containing a malicious postinstall hook. This allowed the malicious code to execute during package installation without immediate detection.
r/Malware (opens in a new tab)u/BattleRemote31570 points0 comments
The attacker didn't touch any Mastra source code but just added one dependency to every package: easy-day-js which is a clean-looking dayjs clone. The trick was in semver that is they pinned ^1.11.21 but the latest tag pointed to 1.11.22 which had a postinstall hook. You audit 1.11.21but npm installs 1.11.22.
full details - https://safedep.io/mastra-npm-scope-takeover-supply-chain-attack/