Detection queries Not classified

Tensorlake AI sandbox SDK hijacked with Shai-Hulud stealer by ChainDrop

Oct 17, 2026: Actor 'ChainDrop' compromised Tensorlake maintainer's npm account via phishing. Published malicious TensorZero@1.8.4, @tensorzero/gateway@2.0.1, @tensorzero/cli@1.4.0. Embedded obfuscated…

What happened

Oct 17, 2026: Actor 'ChainDrop' compromised Tensorlake maintainer's npm account via phishing. Published malicious TensorZero@1.8.4, @tensorzero/gateway@2.0.1, @tensorzero/cli@1.4.0. Embedded obfuscated Shai-Hulud infostealer targeting AI development credentials: Cursor IDE (.cursor/User/globalStorage/*.json), Claude Desktop (~/Library/Application Support/Claude), OpenAI keys (env vars, .openai/), GitHub tokens (~/.config/gh/), AWS credentials (~/.aws/), Docker configs, SSH keys. Exfiltrated to discord.com/api/webhooks/... and hxxps://tensorlakeapi[.]online/api/collect. Packages removed within 3 hours; ~450 downloads during window. TensorZero is LLM gateway/observability platform for engineering teams. ChainDrop previously linked to @tensorzero/keyv Mini Shai-Hulud campaign (Aug 7, GitGuardian) and other AI supply chain hits. Detection: monitor npm package.json for unexpected dependencies, review postinstall scripts, check for base64/eval obfuscation, scan for Discord webhook URLs, monitor file access to AI credential paths.

Supply chain compromise of TensorZero AI sandbox SDK (github.com/tensorlake/tensorzero) to deliver Shai-Hulud credential stealer targeting AI development tools

Read the original sourceAdditional source: TensorZero - LLM Gateway for Engineering Teams

How it happened

Select a stage to explore its defenses
Detect this stage
Detect this stage
Detect this stage
Detect this stage
Select a stage · Drag to explore · + / − to zoom · Dashed edges are loopsSelect a stage · Arrows show reported connectionsReported sequence
Read the flow as text & sources

A catalog reconstruction of the supplied source account. Unknown steps remain explicit; an edge describes the reported relationship between steps.

  1. 01 · Compromise maintainer account

    ChainDrop phished Tensorlake maintainer's npm credentials to gain publish access to @tensorzero packages

    Hunt: An impersonating message, ad or website leads to a suspicious download, consent request, pasted command or payment instruction.

    Polished text, AI branding and a novel domain do not prove maliciousness or AI generation. Follow-on evidence matters.

    Source for step 1
  2. 02 · Publish malicious packages

    Published malicious versions: TensorZero@1.8.4, @tensorzero/gateway@2.0.1, @tensorzero/cli@1.4.0 with embedded Shai-Hulud stealer in obfuscated postinstall script

    Hunt: A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.

    Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.

    Source for step 2
  3. 03 · Execute credential harvesting

    Postinstall script runs Shai-Hulud: scans filesystem for Cursor IDE config, Claude Desktop tokens, OpenAI keys, GitHub tokens, AWS credentials, Docker configs, SSH keys; base64 encodes and stages

    Hunt: A package-manager install or lifecycle script launches a shell, downloader, or script interpreter that retrieves or executes an unexpected second stage.

    Build and install scripts commonly invoke shells and download dependencies. Require package provenance and destination context; this hunt does not by itself prove supply-chain compromise.

    Source for step 3
  4. 04 · Exfiltrate credentials

    POST stolen credentials to Discord webhook and hxxps://tensorlakeapi[.]online/api/collect; credentials enable downstream AI service abuse and lateral movement

    Hunt: Sensitive reads are followed by outbound transfer, a public artifact, or a tool call to a destination outside the approved workflow.

    An outbound connection or high byte count alone is not exfiltration. Encrypted traffic may hide content, and bulk legitimate exports are common.

    Source for step 4

Why it matters

Reported entry point: npm install of malicious @tensorzero/* packages (1.8.4, gateway@2.0.1, cli@1.4.0) via compromised maintainer account. Reported impact: POST stolen credentials to Discord webhook and hxxps://tensorlakeapi[.]online/api/collect; credentials enable downstream AI service abuse and lateral movement; reported targets include ~450 downloads during 3-hour window; AI/ML engineering teams using TensorZero; broader Shai-Hulud campaign targets AI developers; applicability to your setup has not been assessed, so verify affected versions, permissions, and configuration in the original report.

Read the original report

What you can do

Protection & prevention

Verify npm package integrity; review postinstall scripts; monitor for unexpected dependencies; use npm audit; implement software composition analysis (SCA); rotate credentials after suspected exposure; use credential vaults; monitor file access to AI credential stores; network egress filtering for Discord/unknown domains

Catalog defensive guidance based on the reported behavior. Confirm scope and current mitigations in the original source.

Review the original guidance Additional source 2
Investigate each phase

Detection queries

Draft query starters grouped by the attack stages where they apply.

Download stage pack

Start with the logs you collect. Each hunt identifies its required visibility, field mapping and limits. Queries are catalog-authored drafts using reusable behavior profiles; test with known activity and your normal baseline before alerting.

01Compromise maintainer accountLure → user action / deliveryCustom schema · Draft

ChainDrop phished Tensorlake maintainer's npm credentials to gain publish access to @tensorzero packages

What to look for

An impersonating message, ad or website leads to a suspicious download, consent request, pasted command or payment instruction.

Visibility: Defender-side logs where collected

Required logs

  • Email / secure-web-gateway records
  • Browser redirects, downloads and URL reputation
  • User reports and downstream execution / identity events

Coverage limit. Polished text, AI branding and a novel domain do not prove maliciousness or AI generation. Follow-on evidence matters.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Lure → user action / delivery
id: e0056b49-9905-485b-ac12-2aa076a7bc82
status: experimental
description: An impersonating message, ad or website leads to a suspicious
  download, consent request, pasted command or payment instruction.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - message.link.click
      - web.download
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("message.link.click", "web.download")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("message.link.click", "web.download")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Reconstruct redirect and delivery provenance using original report indicators, without visiting payload URLs.
  2. Correlate the click with the actual download, consent or execution; verify the sender through an independent channel.
02Publish malicious packagesDependency / CI trust boundaryCustom schema · Draft

Published malicious versions: TensorZero@1.8.4, @tensorzero/gateway@2.0.1, @tensorzero/cli@1.4.0 with embedded Shai-Hulud stealer in obfuscated postinstall script

What to look for

A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.

Visibility: Defender-side logs where collected

Required logs

  • Package-manager and CI job logs
  • Lockfile / manifest / workflow diffs
  • Runner process trees, secret access and egress

Coverage limit. Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Dependency / CI trust boundary
id: 5fa9c45a-ac1c-4666-a598-e80626320997
status: experimental
description: A package or workflow change introduces a lifecycle hook, remote
  dependency or new command that accesses secrets or external services.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - package.install
      - ci.workflow.change
      - package.lifecycle.exec
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("package.install", "ci.workflow.change", "package.lifecycle.exec")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("package.install", "ci.workflow.change", "package.lifecycle.exec")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Compare package provenance, publish identity, lifecycle scripts and resolved dependency URLs with the approved version.
  2. Correlate the install or workflow to secret reads and subsequent token use; distinguish exposure from confirmed compromise.
03Execute credential harvestingPackage installation spawns a shell or downloaderNative logs · Draft

Postinstall script runs Shai-Hulud: scans filesystem for Cursor IDE config, Claude Desktop tokens, OpenAI keys, GitHub tokens, AWS credentials, Docker configs, SSH keys; base64 encodes and stages

What to look for

A package-manager install or lifecycle script launches a shell, downloader, or script interpreter that retrieves or executes an unexpected second stage.

Visibility: Endpoint process telemetry where collected

Required logs

  • Process creation with ancestry and complete command lines
  • Package-manager, CI, and installation logs
  • Download, file creation, signature, and network telemetry

Coverage limit. Build and install scripts commonly invoke shells and download dependencies. Require package provenance and destination context; this hunt does not by itself prove supply-chain compromise.

Process candidates with package-manager ancestry that launch shells or downloaders. Tune known build tooling and correlate with network/file telemetry.

MCP reference matches: Curl Download Activity from npm Package Install (Elastic detection-rules), Suspicious PowerShell from npm Package Install (Elastic detection-rules). The query below is a catalog adaptation, not a verbatim upstream rule.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Shell or Downloader Spawned by Package Installation
id: c83f22aa-d07c-4f3c-a67f-6d5512818133
status: experimental
description: Detects package-manager processes spawning common shells, interpreters, or downloaders.
author: MagicSword OpenAttacks catalog
date: 2026-11-06
references:
  - https://github.com/elastic/detection-rules/blob/main/rules/cross-platform/command_and_control_curl_download_from_npm_install.toml
falsepositives:
  - Legitimate package build and installation scripts
level: medium
logsource:
  category: process_creation
detection:
  selection_parent:
    ParentCommandLine|contains:
      - npm-cli.js
      - npx-cli.js
      - yarn
      - pnpm
      - pip install
      - python -m pip
      - gem install
  selection_child:
    Image|endswith:
      - \powershell.exe
      - \pwsh.exe
      - /sh
      - /bash
      - /zsh
      - /curl
      - /wget
      - /python
      - /node
  condition: all of selection_*
KQL
Draft KQLDownload KQL
DeviceProcessEvents
| where Timestamp > ago(7d)
| where InitiatingProcessCommandLine has_any ("npm-cli.js", "npx-cli.js", "yarn", "pnpm",
    "pip install", "python -m pip", "gem install")
| where FileName in~ ("powershell.exe", "pwsh.exe", "sh", "bash", "zsh", "curl", "wget", "python", "node")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
    InitiatingProcessFileName, InitiatingProcessCommandLine, SHA1
| order by Timestamp desc
SPL
Draft SPLDownload SPL
| tstats count min(_time) as firstTime max(_time) as lastTime
  from datamodel=Endpoint.Processes
  where Processes.parent_process IN ("*npm-cli.js*", "*npx-cli.js*", "*yarn*", "*pnpm*",
    "*pip install*", "*python -m pip*", "*gem install*")
  Processes.process_name IN ("powershell.exe", "pwsh.exe", "sh", "bash", "zsh", "curl", "wget", "python", "node")
  by Processes.dest Processes.user Processes.process_name Processes.process
     Processes.parent_process_name Processes.parent_process
| `drop_dm_object_name(Processes)`
| sort - lastTime
Investigation steps
  1. Identify the package, version, publisher, lifecycle hook, resolved source, and parent process.
  2. Recover downloaded content and correlate credential access, persistence, or outbound traffic.
04Exfiltrate credentialsSensitive data → unusual destinationCustom schema · Draft

POST stolen credentials to Discord webhook and hxxps://tensorlakeapi[.]online/api/collect; credentials enable downstream AI service abuse and lateral movement

What to look for

Sensitive reads are followed by outbound transfer, a public artifact, or a tool call to a destination outside the approved workflow.

Visibility: Defender-side logs where collected

Required logs

  • Sensitive resource access / DLP records
  • Proxy, egress and cloud upload events
  • Agent / SaaS audit with correlation IDs

Coverage limit. An outbound connection or high byte count alone is not exfiltration. Encrypted traffic may hide content, and bulk legitimate exports are common.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Sensitive data → unusual destination
id: 04b60968-3179-4b1f-ae13-6f57c2446077
status: experimental
description: Sensitive reads are followed by outbound transfer, a public
  artifact, or a tool call to a destination outside the approved workflow.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - data.export
      - agent.external.send
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("data.export", "agent.external.send")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("data.export", "agent.external.send")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Join the resource read and outbound action by session, identity or process, preserving a bounded time window.
  2. Inspect destination ownership, payload classification and the user's intended action; baseline sanctioned sharing.
Technical detailsTooling, impact & MITRE ATLAS

Attack context

AI's role
AI credential theft
Additional role
AI tool as lure
Initial access
npm install of malicious @tensorzero/* packages (1.8.4, gateway@2.0.1, cli@1.4.0) via compromised maintainer account

Tooling as reported

AI products, models and artifacts

Other tooling

  • Shai-Hulud credential stealer
  • npm supply chain attack
  • Discord webhooks for exfiltration
  • tensorlakeapi[.]online C2

Targets and reported impact

Targets / sectors
~450 downloads during 3-hour window; AI/ML engineering teams using TensorZero; broader Shai-Hulud campaign targets AI developers
Reported scale / exposure
~450 downloads in 3-hour window; packages removed within 3 hours of publication; part of broader Shai-Hulud campaign across AI tooling ecosystem
Target geography
Multiple regions

Reported attribution

Actor 'ChainDrop'; linked to Mini Shai-Hulud keyv campaign (Aug 7); persistent targeting of AI development supply chains

Structured attribution

Actor
ChainDrop
Country
Unknown
Motivation
financially-motivated
Attributed by
Socket Security
Attribution confidence
high

Detection rules

  • npm postinstall script monitoringGUIDANCE

    Monitor npm postinstall scripts for file system access to AI credential paths (~/.cursor/, ~/Library/Application Support/Claude, ~/.openai/, ~/.config/gh/, ~/.aws/); alert on Discord webhook URLs or unknown C2 domains in install scripts

  • Network egress monitoringGUIDANCE

    Alert on POST requests to tensorlakeapi[.]online or Discord webhook domains from npm/Node processes; monitor base64-encoded data exfiltration

Activity timeline

First seen
2026-10-17
Last updated
2026-11-04

Updates

  • 2026-10-17 — Socket Security

    TensorZero packages compromised via phished maintainer credentials; ~450 downloads in 3-hour window before removal

Source defensive notes

Verify npm package integrity; review postinstall scripts; monitor for unexpected dependencies; use npm audit; implement software composition analysis (SCA); rotate credentials after suspected exposure; use credential vaults; monitor file access to AI credential stores; network egress filtering for Discord/unknown domains

MITRE ATLAS

AI-specific catalog annotations based on the reported behavior; these are not MITRE case-study assignments.

AML.T0000Search Open Technical Databases

Supply chain compromise of AI development SDK to steal AI service credentials and API keys Source

Indicators of compromise

domains

  • tensorlakeapi.online

ips

    hashes

      urls

      • https://discord.com/api/webhooks/...

      Sources & research credit

      2 sources

      Research by Socket Security Research Team · Socket

      1. Socket: AI Sandbox SDK Compromised in Supply Chain Attack socket.dev
      2. TensorZero - LLM Gateway for Engineering Teams github.com

      Socket Security analysis; TensorZero GitHub repo github.com/tensorlake/tensorzero. Related to s1ngularity-nx-ai-cli-2025-08 entry (Shai-Hulud targeting NX.dev AI CLI) and Mini Shai-Hulud keyv campaign. Detection: monitor for 'Shai-Hulud' patterns (Discord webhooks, base64 obfuscation in postinstall, AI credential path access .cursor/*, Claude config access, env var harvesting), alert on npm packages with obfuscated postinstall scripts, check for tensorlakeapi[.]online domain.

      Record & downloads
      Source record name
      Tensorlake AI sandbox SDK hijacked with Shai-Hulud stealer by ChainDrop
      Entry ID
      tensorlake-shai-hulud-chaindrop-2026-10
      Catalog review
      November 4, 2026
      Category
      attacks-on-ai
      AI involvement confidence
      confirmed