ATT&CKReferencesMIcrosoft Mastra npm Compromise JUN 2026

MIcrosoft Mastra npm Compromise JUN 2026

Microsoft Threat Intelligence. (2026, June 17). From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet. Retrieved September 30, 2026.

Published

Open the source

Techniques48

Groups1

Software0

None recorded.

Campaigns0

None recorded.

Procedure examples48

TechniqueUsed byProcedure example
T1012
Query Registry
GroupAPT38

APT38 has run node.js malware to query the Registry to discover installed software.

T1027.010
Command Obfuscation
GroupAPT38

APT38 has utilized Base64 encoded PowerShell scripts.

T1033
System Owner/User Discovery
GroupAPT38

APT38 has identified primary users, currently logged in users, sets of users that commonly use a system, or inactive users. APT38 has run malware to enumerate the current user on compromised hosts.

T1036.005
Match Legitimate Resource Name or Location
GroupAPT38

APT38 has named malicious payloads as benign-looking executables to blend in the environment including Run keys, npm packages, and JavaScript utilities often using names mirroring Apple, Windows, or other native system files.

T1041
Exfiltration Over C2 Channel
GroupAPT38

APT38 has exfiltrated victim device and user details contained in a POST request to register the compromised system with C2 infrastructure.

T1048.002
Exfiltration Over Asymmetric Encrypted Non-C2 Protocol
GroupAPT38

APT38 has used malware to exfiltrate stolen data with a custom ICAP-style protocol over HTTPS.

T1053.006
Systemd Timers
GroupAPT38

APT38 has used a multiplatform implant that can write to `~/.config/systemd/nvmconf/` to gain persistence on Linux hosts.

T1056.002
GUI Input Capture
GroupAPT38

APT38 has leveraged a fictitious native macOS password dialog prompt to entice victims to enter credentials.

T1057
Process Discovery
GroupAPT38

APT38 leveraged Sysmon to understand the processes, services in the organization. APT38 has used Python versions of its remote access tools on Linux targets. APT38 has also configured malicious payloads to gather running processes using `ps aux`.

T1059.001
PowerShell
GroupAPT38

APT38 has used PowerShell to execute commands and other operational tasks.
APT38 has also used PowerShell to establish persistence and establish C2 communication on compromised hosts.

T1059.003
Windows Command Shell
GroupAPT38

APT38 has used a command-line tunneler, NACHOCHEESE, to give them shell access to a victim’s machine. Additionally, APT38 has used batch scripts. APT38 has also executed scripts to launch `cmd.exe` to POST stolen data to actor-controlled domains.

T1059.007
JavaScript
GroupAPT38

APT38 has utilized malicious JavaScript payloads to compromise victims.

T1070.003
Clear Command History
GroupAPT38

APT38 has executed scripts to delete the PowerShell command history file.

T1074.001
Local Data Staging
GroupAPT38

APT38 has staged files in a central location prior to exfiltration.

T1078.004
Cloud Accounts
GroupAPT38

APT38 has used victim maintainer accounts for the npm Registry to publish malicious packages.

T1082
System Information Discovery
GroupAPT38

APT38 has attempted to get detailed information about a compromised host, including the operating system, version, patches, hotfixes, and service packs. APT38 has executed malware to collect current user, host name, system time, and operating system install date from targeted systems.

T1105
Ingress Tool Transfer
GroupAPT38

APT38 used a backdoor, NESTEGG, that has the capability to download and upload files to and from a victim’s machine. Additionally, APT38 has downloaded other payloads onto a victim’s machine. APT38 has also injected npm packages with malicious dependencies that download second-stage payloads to victim machines.

T1132.001
Standard Encoding
GroupAPT38

APT38 has utilized Base64 encoded HTTP POST communications to C2.

T1140
Deobfuscate/Decode Files or Information
GroupAPT38

APT38 has used the RC4 algorithm to decrypt configuration data. APT38 has decocoded Base64 encoded PowerShell scripts prior to execution.

T1195.001
Compromise Software Dependencies and Development Tools
GroupAPT38

APT38 has injected malicious dependencies into software packages such as Axios and Mastra npm packages.

T1204.001
Malicious Link
GroupAPT38

APT38 has used links to execute a malicious Visual Basic script. APT38 has directed users to navigate to a website under adversary control through the sharing of links in messages.

T1217
Browser Information Discovery
GroupAPT38

APT38 has collected browser bookmark information to learn more about compromised hosts, obtain personal information about users, and acquire details about internal network resources. APT38 has also used malware capable of enumerating 166 unique cryptocurrency wallets, browser extensions, and browser history.

T1518
Software Discovery
GroupAPT38

APT38 has enumerated installed applications to build an inventory of the system’s software environment.

T1518.001
Security Software Discovery
GroupAPT38

APT38 has identified security software, configurations, defensive tools, and sensors installed on a compromised system. APT38 has also executed malware implants to enumerate all installed applications on Windows hosts including installed security products.

T1543.001
Launch Agent
GroupAPT38

APT38 has executed a multiplatform implant that placed launch agents in ~/Library/NodePackages/ to establish persistence on macOS.

T1543.003
Windows Service
GroupAPT38

APT38 has installed a new Windows service to establish persistence. APT38 has gained persistence on compromised systems independent of user logon by creating a background service using `sc create scdev binPath= "c:\windows\system32\svchost.exe -k scdev".

T1546.016
Installer Packages
GroupAPT38

APT38 has poisoned Axios and Mastra npm packages with malicious post-install hooks.

T1547.001
Registry Run Keys / Startup Folder
GroupAPT38

APT38 has also added registry run keys within `HKCU:\Software\Microsoft\Windows\CurrentVersion\Run\MicrosoftUpdate` to enable persistence on Windows devices after reboot. APT38 has executed a multiplatform implant that dropped a Registry Run key to `:\ProgramData\NodePackages\` for persistence on Windows machines. APT38 has obtained boot- persistence on compromised systems independent of user logon by adding the registry key `HKLM\SYSTEM\CurrentControlSet\services\scdev\Parameters`.

T1548.006
TCC Manipulation
GroupAPT38

APT38 has used Finder, a macOS native app with FDA permissions, to rename the folder `com.apple.TCC`, then used another process to move the `TCC.db` file to a new location, where SQLite3 was used to edit `TCC.db`. The edited `TCC.db` file allowed code signing authorization, permission access, etc. without requiring a user prompt.

T1552.003
Shell History
GroupAPT38

APT38 has gathered data and credentials stored in Shell History.

T1555.003
Credentials from Web Browsers
GroupAPT38

APT38 has gathered Web browser data to include saved credentials, cookies, bookmarks, autofill data, and extension-specific storage. APT38 has also sought cryptocurrency wallet extensions.

T1564.003
Hidden Window
GroupAPT38

APT38 has configured malicious scripts to execute in hidden windows.

T1564.012
File/Path Exclusions
GroupAPT38

APT38 has added Microsoft Defender exclusions to include `C:\Windows\System32` to suppress detection of dropped tooling.

T1566.003
Spearphishing via Service
GroupAPT38

APT38 has used social media sites such as LinkedIn to send malicious links to potential vicitims.

T1567
Exfiltration Over Web Service
GroupAPT38

APT38 has exfiltrated stolen credentials to actor-controlled infrastructure leveraging Telegram Bot API.

T1569.002
Service Execution
GroupAPT38

APT38 has created new services or modified existing ones to run executables, commands, or scripts. APT38 has also installed a persistent service on targeted hosts to load malicious DLLs at boot.

T1571
Non-Standard Port
GroupAPT38

APT38 has leveraged unique non-standard ports for communications with actor-controlled C2 infrastructure to include Port 8000.

T1583.001
Domains
GroupAPT38

APT38 has created fake domains to imitate legitimate venture capital or bank domains. APT38 has acquired domains to host fake skill assessments leading to malware download. APT38 has registered domains that masquerade as financial institutions and resemble legitimate services. APT38 has also obtained C2 domains to host second-stage malicious payloads.

T1583.003
Virtual Private Server
GroupAPT38

APT38 has used virtual private server (VPS) providers to host C2 infrastructure including Hostwinds.

T1583.006
Web Services
GroupAPT38

APT38 has used OneDrive and GoogleDrive to host malicious files.

T1585.001
Social Media Accounts
GroupAPT38

APT38 has used professional platforms such as LinkedIn to contact potential victims.

T1585.002
Email Accounts
GroupAPT38

APT38 has set up anonymous emails to use in publishing poisoned software packages such as sergey2016@tutamail[.]com.

T1586.003
Cloud Accounts
GroupAPT38

APT38 has used virtual private server (VPS) providers to host C2 infrastructure including Hostwinds.

T1608.001
Upload Malware
GroupAPT38

APT38 has uploaded malware to cloud storage services for download by targeted victims.

T1620
Reflective Code Loading
GroupAPT38

APT38 has configured malicious payloads to reflectively load using the macOS `NSCreateObjectFileImageFromMemory` API.
APT38 has also reflectively loaded .NET DLLs to bypass disk-based detection.

T1677
Poisoned Pipeline Execution
GroupAPT38

APT38 has poisoned npm packages with fake runtime dependencies to trigger execution of malicious payloads on developer endpoints or continuous integration and continuous delivery (CI/CD) systems during npm installation or update.

T1678
Delay Execution
GroupAPT38

APT38 has delayed C2 beaconing to longer intervals on network failures.

T1690
Prevent Command History Logging
GroupAPT38

APT38 has prepended a space to all of their terminal commands to operate without leaving traces in the HISTCONTROL environment.
APT38 has prevented logging and muted error logs through the use of `/dev/null 2>&1 &`.
APT38 has also executed scripts to delete the PowerShell command history file and to prevent future history recording using `-Force Set-PSReadLineOption -HistorySaveStyle SaveNothing`.

Data from MITRE ATT&CK® (Enterprise). ATT&CK® is a registered trademark of The MITRE Corporation.