Skip to content
.ca
5 minhigh

Inside a malicious Claude Code-branded extension and its persistent SSH backdoor | Microsoft Security Blog

A tampered Claude Code extension in Cursor's marketplace installed a persistent SSH backdoor by injecting attacker-controlled keys and reverse tunnels across macOS, Linux, and Windows hosts. The malicious extension (anthropic.claude-code v2.1.312/2.1.313) was live in Cursor's marketplace for ~11 hours. Its injected JavaScript adds an Ed25519 SSH key labeled svc-telemetry, creates reverse SSH tunnels to 134.209.82.225, and writes platform-specific persistence scripts outside the extension directory. SSH access was blocked on most hosts, but key planting and persistence artifacts may persist even after extension removal.

Sens:■ ImmediateConf:highAnalyzed:2026-11-05Z.ai

Authors: Microsoft Threat Intelligence

ActorsMalicious Claude Code branded extension v2.1.313

Source:Microsoft

Indicators of Compromise10
6file path2sha2561ip1url
Improve this report

Send corrections, useful missing information, or quality feedback. It is private and will not appear as a comment.

Feedback type

Detection / HunterZ.ai

Immediate Actions

  • Identify systems that installed anthropic.claude-code v2.1.312 or v2.1.313 from Cursor marketplace.
  • Isolate devices with evidence of loader execution or backdoor installation.
  • Remove trojanized extension and all persistence artifacts from IOC table.
  • Rotate credentials and revoke sessions when telemetry indicates exposure.

Key Takeaways

  • Versions 2.1.312 and 2.1.313 were live in Cursor marketplace Oct 29, 2:27 AM–1:35 PM PDT
  • Microsoft VS Marketplace and npm @anthropic-ai/claude-code were not affected
  • Anthropic confirmed their systems were not compromised and did not develop the malicious package
  • Loader collects up to 40 environment-variable names matching KEY, TOKEN, SECRET, PASS, AWS, or GCP
  • Persistence uses names resembling system monitors (SysMon, com.apple.sysmond) to evade suspicion

Attack Chain

  1. Initial Access: Malicious extension installed or auto-updated from Cursor marketplace
  2. Execution: Injected JavaScript runs before extension initialization, collecting host recon
  3. Persistence: SSH key appended to authorized_keys with comment svc-telemetry
  4. Command and Control: Reverse SSH tunnel established to 134[.]209[.]82[.]225
  5. Persistence: Platform-specific startup scripts written outside extension directory
  6. Exfiltration: Delayed callback sends host details and matching env var names

Affected Systems

  • macOS systems with Cursor IDE and Claude Code extension
  • Linux systems with Cursor IDE and Claude Code extension
  • Windows systems with Cursor IDE and Claude Code extension
  • anthropic.claude-code extension versions 2.1.312 and 2.1.313
  • Cursor Extension Marketplace users with auto-update enabled

Detection Availability

  • Published: KQL
  • Platforms: Microsoft Defender XDR, Microsoft Defender Antivirus

KQL advanced hunting queries, Defender XDR detections, and Defender Antivirus signatures available in blog post.

Detection Engineering Assessment

Hunting Hypotheses

copy:
HypothesisTelemetryStageFP Risk
Hunt for SSH processes with reverse tunnel arguments spawned by code editor or extension processes (T1572)Process command-line and network connection logsCommand and ControlLow — reverse tunnel from IDE is unusual
Hunt for authorized_keys modifications containing the comment svc-telemetry (T1098.004)File modification events on SSH authorized_keysPersistenceLow — specific comment marker
Hunt for LaunchAgent or Startup folder entries created by code editor processes (T1543.001, T1547.001)Plist, scheduled task, and file creation eventsPersistenceMedium — developers may create tasks
Hunt for hidden files matching .stk_ prefix in user home or temp directories (T1564.001)File creation events with .stk_ filename prefixCommand and ControlLow — non-standard pattern

Required Log Sources

  • DeviceNetworkEvents (Microsoft Defender XDR)
  • DeviceFileEvents (Microsoft Defender XDR)
  • DeviceEvents (Microsoft Defender XDR)
  • SSH authentication logs
  • Cursor extension install logs
  • Process creation command-line logs

Control Gaps

  • Extension marketplace lacked publisher verification at publication time
  • SSH host-key checking bypassed by loader configuration
  • Persistence artifacts written outside extension installation directory
  • Extension auto-update installed malicious versions without delay

Recommendations

Infrastructure Hardening

  • Restrict Cursor extensions to approved publishers and enable installation cooldown.
  • Block outbound SSH connections from developer workstations to non-approved destinations.
  • Monitor authorized_keys file modifications across all managed endpoints.
  • Verify Claude Code extension source is Microsoft VS Marketplace or npm.

User Protection

  • Disable extension auto-update in environments without publisher verification.
  • Verify extension publisher identity before installation on developer workstations.
  • Remove leftover persistence artifacts after extension removal; updating does not clean them.

MITRE ATT&CK Mapping

IOCs · 10
.txt.json
Showing defanged values