Supply chain attack hits Mastra ecosystem
A supply chain attack compromised over 140 packages in the Mastra AI framework ecosystem on the npm registry via a hijacked contributor account. The poisoned updates introduced a typosquatted dependency executing a malicious postinstall script that deployed an info-stealer to harvest developer credentials and API keys.
Supply chain attacks target build-time execution environments rather than runtime code, transforming developer machines and CI/CD runners into high-value infiltration points.
- –The attack capitalized on a single maintainer account compromise to rapidly inject a malicious dependency across more than 140 packages.
- –By abusing npm postinstall scripts, the malware executed immediately upon installation without requiring the developer to import or run the package.
- –The focus on an AI framework like Mastra highlights a growing trend of targeting developer environments rich in LLM API keys and cloud credentials.
- –Disabling postinstall scripts and using strict package locking/provenance verification remain essential but under-adopted defense practices.
DISCOVERED
1h ago
2026-06-18
PUBLISHED
1h ago
2026-06-18
RELEVANCE
AUTHOR
AikidoSecurity