Hackers News Hackers News
  • CyberSecurity News
  • Threats
  • Attacks
  • Vulnerabilities
  • Breaches
  • Comparisons

Social Media

Hackers News Hackers News
  • CyberSecurity News
  • Threats
  • Attacks
  • Vulnerabilities
  • Breaches
  • Comparisons
Search the Site
Popular Searches:
technology Amazon AI
Recent Posts
Microsoft August 2026 Patch Tuesday fixes 394 flaws, including 3 zero-days
August 11, 2026
Critical Zoom Zero-Click Flaws Let Attackers Hijack User Devices
August 11, 2026
DEF CON Attendees Broadcast Fake Wi-Fi Network on Flight
August 11, 2026
Home/CyberSecurity News/Critical Flaw in Mastra npm Packages Exposes Users to Password Stealing Malware
CyberSecurity News

Critical Flaw in Mastra npm Packages Exposes Users to Password Stealing Malware

Key Takeaways A significant supply chain attack impacted 141 npm packages within the Mastra-AI ecosystem. The attack leveraged a typosquatting dependency to deploy a multi-stage infostealer,...

David kimber
David kimber
June 17, 2026 4 Min Read
49 0

Key Takeaways

  • A significant supply chain attack impacted 141 npm packages within the Mastra-AI ecosystem.
  • The attack leveraged a typosquatting dependency to deploy a multi-stage infostealer, compromising developer machines and build environments.
  • The malware is designed to steal cryptocurrency wallet data, browser history, and sensitive credentials.
  • The critically affected @mastra/core package has over 918,000 weekly downloads, indicating a broad potential impact.
  • Immediate mitigation steps include checking for compromise, removing malicious packages, and rotating credentials.

Sophisticated Supply Chain Attack Targets Mastra npm Packages with Infostealer

A sophisticated supply chain attack has been uncovered, compromising over 141 packages in the Mastra-AI npm ecosystem. Research teams at Microsoft and Socket identified these malicious packages, which secretly deploy an advanced infostealer payload onto developer workstations, CI/CD runners, and various build environments.

Table Of Content

  • Key Takeaways
  • Sophisticated Supply Chain Attack Targets Mastra npm Packages with Infostealer
  • Attack Vector and Timeline
  • Multi-Stage Malware Deployment
  • Stage 1 — The Loader (setup.cjs)
  • Stage 2 — The Implant (protocal.cjs)
  • What You Should Do
  • IoCs
  • Network Indicators
  • Code & String Indicators

The campaign, first detected on June 17, 2026, exploited a typosquatting dependency to deliver a multi-stage malware. This highly capable payload is designed to exfiltrate critical data, including cryptocurrency wallet information, browser histories, and sensitive credentials.

Attack Vector and Timeline

Between 01:15 and 02:36 UTC on June 17, a single npm account, identified as “ehindero,” rapidly published malicious versions of 141 @mastra/* packages. The compromised package code was byte-for-byte identical to its legitimate counterparts, with the only alteration being the injection of a single malicious dependency into each manifest:

"easy-day-js": "^1.11.21"

The dependency easy-day-js is a deliberate typosquat of the widely used dayjs library. It was published the day prior by a separate account named “sergey2016.” Initially, version 1.11.21 of easy-day-js was a clean copy of dayjs, likely intended to establish a benign history.

However, version 1.11.22 introduced a weaponized postinstall hook that executed node setup.cjs. This critical change allowed the malicious payload to run automatically during npm install, even before any developer explicitly imported or used the package.

Among the affected packages is @mastra/core, a highly popular library with over 918,000 weekly npm downloads. This extensive reach indicates a substantial potential blast radius for the campaign.

Multi-Stage Malware Deployment

The attack unfolds in two distinct stages, each designed for stealth and persistence.

Stage 1 — The Loader (setup.cjs)

The initial loader, obfuscated using obfuscator.io, performs several critical functions. It disables TLS certificate verification by setting NODE_TLS_REJECT_UNAUTHORIZED=0, then writes tracking files (~/.pkg_history and ~/.pkg_logs) to fingerprint the victim machine. Following this, it fetches a second-stage payload from 23[.]254[.]164[.]92:8000/update/49890878 and launches it as a detached, hidden background process. This process then connects to the command-and-control (C2) server at 23[.]254[.]164[.]123:443. The loader then self-deletes to remove forensic evidence.

Stage 2 — The Implant (protocal.cjs)

The second stage involves a cross-platform Node.js tasking client, approximately 41 KB in size, named protocal.cjs. This implant establishes persistent access across major operating systems. On Windows, it creates a Registry Run key (NvmProtocal); on macOS, it installs a LaunchAgent (com.nvm.protocal.plist); and on Linux, it utilizes a systemd user unit (nvmconf.service). All persistence mechanisms are cleverly disguised as legitimate Node.js tooling to evade detection within developer environments.

Once established, the implant beacons to the operator’s C2 server, awaiting arbitrary commands. Its built-in capabilities include inventorying 166 cryptocurrency wallet browser extensions, such as MetaMask, Phantom, Coinbase Wallet, Binance Wallet, and TronLink. It also exfiltrates browser history from Chrome, Edge, and Brave using Node’s built-in SQLite module and conducts host reconnaissance, detailing running processes and installed applications.

What You Should Do

  • Assume Compromise: Any system that executed npm install on affected @mastra/* versions should be considered compromised.
  • Check for Exposure: Immediately run npm ls easy-day-js to identify if your environment is affected.
  • Remove Malicious Packages: Remove any identified affected versions of @mastra/* packages.
  • Pin to Safe Version: Update your project to use [email protected] and enforce this with lockfiles.
  • Remove Persistence Artifacts: Manually remove all persistence mechanisms (Windows Registry Run key NvmProtocal, macOS LaunchAgent com.nvm.protocal.plist, Linux systemd user unit nvmconf.service) from affected systems.
  • Rotate Credentials: Immediately rotate all credentials that were present in the installation environment, including npm tokens, GitHub tokens, cloud provider keys, and CI/CD secrets.
  • Secure Cryptocurrency Wallets: For high-value cryptocurrency holdings, transfer funds to a new wallet generated from a fresh seed phrase on a completely clean and trusted device.
  • Enhance CI/CD Security: Implement npm install --ignore-scripts by default in CI pipelines, enforce strict use of lockfiles, introduce package cooldown periods for newly published versions, and monitor for outbound connections to raw IP addresses during build processes.

IoCs

Network Indicators

Type Indicator Description
IP Address 23.254.164[.]92 Stage-2 payload delivery server
URL https://23.254.164[.]92:8000/update/49890878 Stage-2 download endpoint
IP Address 23.254.164[.]123 C2 exfiltration server
URL https://23.254.164[.]123:443/49890878 C2 exfiltration endpoint
ASN AS54290 Hostwinds LLC (attacker-controlled infrastructure)
Domain hwsrv-1327786.hostwindsdns[.]com Associated attacker domain
Domain hwsrv-1327785.hostwindsdns[.]com Associated attacker domain

Code & String Indicators

Type Indicator Description
Registry Key NvmProtocal Windows HKCU...CurrentVersionRun persistence value
LaunchAgent Label com.nvm.protocal macOS login persistence agent
Systemd Unit nvmconf.service Linux systemd user-level persistence unit
Filename protocal.cjs Dropped Stage-2 implant filename
Directory NodePackages Drop directory name across Windows, macOS, and Linux
File .pkg_history Loader beacon file written to temp directory
File .pkg_logs XOR-encoded campaign marker file
URL Path /update/49890878 Stage-2 download path and bot identifier

Disclaimer: HackersRadar reports on cybersecurity threats and incidents for informational and awareness purposes only. We do not engage in hacking activities, data exfiltration, or the hosting or distribution of stolen or leaked information. All content is based on publicly available sources.

Tags:

AttackExploitHackerMalware

Share Article

David kimber

David kimber

David is a penetration tester turned security journalist with expertise in mobile security, IoT vulnerabilities, and exploit development. As an OSCP-certified security professional, David brings hands-on technical experience to his reporting on vulnerabilities and security research. His articles often feature detailed technical analysis of exploits and provide actionable defense recommendations. David maintains an active presence in the security research community and has contributed to multiple open-source security tools.

Previous Post

AIRecon: AI Penetration Testing Tool Integrates Kali Linux Sandbox

Next Post

U.S. Commerce Dept Imposes Export Controls on Anthropic’s Claude Mythos 5 and Fable 5

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Popular Posts
LLM API Vulnerability Exposes AI Model Reasoning, Poses Data Risk
August 11, 2026
Critical SAP Vulnerabilities Allow Code Injection, Memory Corruption
August 11, 2026
Critical Ivanti Endpoint Manager CVEs Let Remote Attackers Crash Agent Service
August 11, 2026
Top Authors
Marcus Rodriguez
Marcus Rodriguez
Emy Elsamnoudy
Emy Elsamnoudy
Jennifer sherman
Jennifer sherman
Let's Connect
156k
2.25m
285k

Related Posts

Jennifer sherman
By Jennifer sherman
Threats

GlassWorm Attacks macOS via Malicious VS Code…

January 1, 2026
Emy Elsamnoudy
By Emy Elsamnoudy
Attacks

ClickFix Attack Hides Malicious Code via Stegan Security

January 1, 2026
Sarah simpson
By Sarah simpson
Vulnerabilities

MongoBleed Detector Tool Released to Detect MongoDB Vulnerability(CVE-2025-14847)

January 1, 2026
Emy Elsamnoudy
By Emy Elsamnoudy
Breaches

Conti Ransomware Gang Leaders & Infrastructure Exposed

January 1, 2026
Hackers News Hackers News
  • [email protected]

Quick Links

  • Contact Us
  • Privacy Policy
  • Terms of service

Categories

Attacks
Breaches
Comparisons
CyberSecurity News
Threats
Vulnerabilities

Let's keep in touch

receive fresh updates and breaking cyber news every day and week!

All Rights Reserved by HackersRadar ©2026

Follow Us