Threat reportSupply ChainTL-2026-6307
Malicious GitHub Repositories Hijack AI Coding Agents (Claude Code, Cursor) via Poisoned Instruction Files to Steal Developer Credentials
Bitdefender Labs identified 22 malicious GitHub repositories that plant poisoned agent instruction files (AGENTS.md, CLAUDE.md, .claude/settings.json) so AI coding assistants run a hidden setup.js multi-stage loader with the developer's permissions. The Bun-executed payload steals CI/CD, cloud, package registry, browser, password manager, SSH key, .env and API key secrets, and spreads by planting agent configs locally and committing trigger files to other repositories using stolen GitHub/GitLab tokens.
Key facts
| Identifiers | TL-2026-6307 |
|---|---|
| Severity | HIGH |
| First disclosed | |
| Affected products | Anthropic Claude Code; Anysphere Cursor; Multiple AI coding assistants whose config is poisoned for propagation (Codex, Gemini, Copilot, Kiro, OpenCode, Cline, Aider, Tabby, Amazon Q, Cody, Bolt, Continue) |
| Weaknesses (CWE) | CWE-94, CWE-506, CWE-522 |
| Tools | Bun |
| MITRE ATT&CK / ATLAS techniques | AML.T0051.001 LLM Prompt Injection: Indirect, T1027 Obfuscated Files or Information, T1059 Command and Scripting Interpreter, T1059.007 JavaScript, T1140 Deobfuscate/Decode Files or Information, T1195 Supply Chain Compromise, T1195.002 Compromise Software Supply Chain, T1204 User Execution, T1528 Steal Application Access Token, T1546 Event Triggered Execution, T1550.001 Use Alternate Authentication Material: Application Access Token, T1552.001 Credentials In Files and 5 more in the attack flow |
| Motivation | FINANCIAL |
| Target sectors | technology, software development, open source |
| Target regions | Global |
| Detection rules | 9 (1 shown free) |
| Sources | 6 cited sources |
Detection coverage
As of 2026-11-18, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-6307 across Splunk SPL, Microsoft KQL and Sigma, covering 25 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: AI Agent Poisoned-Repo Loader - node scripts/setup.js and node to bun 'run -' Stager Chain
Detects the TL-2026-6307 execution chain: an AI coding agent (or developer) running `node scripts/setup.js` as instructed by a poisoned AGENTS.md/CLAUDE.md, and the Node stager piping its decrypted bundle into the Bun runtime via `bun run -`. The 3.75 MB setup.js (hex+ROT13 stage 0, AES-128-GCM stager) loads a Bun credential stealer targeting CI/CD, cloud, npm/PyPI, SSH, browser and .env secrets.
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1059.007, T1204, T1195.002, T1027, T1140
- Data sources: sysmon, windows_security, edr_process_telemetry
- Severity: high
- Confidence: high
Splunk SPL
index=sysmon sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational EventCode=1 earliest=-24h
| where match(Image,"(?i)(node|bun)([.]exe)?$")
| where match(CommandLine,"(?i)scripts.setup[.]js") OR (match(Image,"(?i)bun([.]exe)?$") AND match(CommandLine,"(?i)[ ]run[ ]+-([ ]|$)") AND match(ParentImage,"(?i)node([.]exe)?$"))
| eval agent_parent=if(match(ParentImage,"(?i)(claude|cursor|codex|gemini|copilot|kiro|opencode|cline|aider|windsurf)([.]exe)?$"),1,0)
| stats count min(_time) as first_seen max(_time) as last_seen values(CommandLine) as command_lines values(ParentImage) as parent_images max(agent_parent) as agent_parent by host user Image
| table first_seen last_seen host user Image parent_images command_lines agent_parent countMicrosoft KQL
let runtimes = dynamic(['node.exe','bun.exe','node','bun']);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (runtimes)
| where ProcessCommandLine matches regex @'(?i)scripts.setup[.]js' or (FileName in~ ('bun.exe','bun') and ProcessCommandLine matches regex @'(?i)[ ]run[ ]+-([ ]|$)' and InitiatingProcessFileName in~ ('node.exe','node'))
| extend AgentParent = InitiatingProcessFileName has_any ('claude','cursor','codex','gemini','copilot','kiro','opencode','cline','aider','windsurf')
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName, AgentParentSigma
title: AI Agent Poisoned Repo Loader - node setup.js or node to bun run Stager
id: 6f1d2a3c-8b47-5c10-9a2e-3d7c41b0a601
status: experimental
description: Detects node executing scripts/setup.js (the loader named in poisoned AGENTS.md and CLAUDE.md) or the Node stager piping a bundle to Bun via bun run - (TL-2026-6307).
references:
- https://www.bitdefender.com/en-us/blog/labs/how-ai-agents-become-new-targets-in-github-malware-campaign
author: Threadlinqs Team
date: 2026-11-18
tags:
- attack.execution
- attack.t1059.007
- attack.t1204
- attack.initial-access
- attack.t1195.002
- attack.defense-evasion
- attack.t1140
logsource:
category: process_creation
product: windows
detection:
selection_setup:
Image|endswith: '\node.exe'
CommandLine|contains:
- 'scripts/setup.js'
- 'scripts\setup.js'
selection_bun:
Image|endswith: '\bun.exe'
ParentImage|endswith: '\node.exe'
CommandLine|endswith: ' run -'
condition: 1 of selection_*
falsepositives:
- Legitimate projects that ship their own scripts/setup.js bootstrap script
- Developers intentionally piping scripts to Bun from a Node based tool
level: high
Known false positives:
- Legitimate repositories that include their own scripts/setup.js bootstrap script executed by developers
- Developers intentionally piping scripts to Bun (bun run -) from a Node-based tool
Tuning notes: Allow-list reviewed internal repos whose scripts/setup.js is known-good; raise priority when agent_parent=1 (parent is an AI coding agent) or when Bun was first seen on the host in the last 24h. Pair with the setup.js MD5 detection (KQL-001). Adapt index/sourcetype to your Sysmon ingestion; on Linux/macOS use auditd or EDR process events.
- Known setup.js Loader Hashes and 3.75 MB [indicator] Files Written to Endpoints · unlock with TL Creds
- Developer Token Harvesting via CLI (gh, glab, npm, aws, az, gcloud, git credential) Spawned from node/bun · unlock with TL Creds
- Token Validation Fan-Out - bun/node Contacting GitHub, GitLab, npm, PyPI, RubyGems and JFrog APIs · unlock with TL Creds
- Propagated Trigger Scripts ([indicator], [indicator]) Executed by Node or Bun · unlock with TL Creds
- Local Propagation - User-Level AI Agent Config (settings.json, mcp.json, config.json) Modified by node/bun · unlock with TL Creds
- Bun Runtime Contacting GitHub/GitLab/PyPI/RubyGems/JFrog APIs (Token Validation and Republish) · unlock with TL Creds
- Worm Propagation - Agent Instruction and Trigger Files Written by node or bun · unlock with TL Creds
- Credential Store Enumeration by node/bun Children - Windows Credential Manager, Password Managers, SSH Keys, Browser Stores · unlock with TL Creds
Indicators of compromise
As of 2026-11-18, Threadlinqs Intelligence tracks 25 indicators of compromise for TL-2026-6307.
Sample indicators (3 of 25)
- File hash:
b9a182b646c7fdff68f2ff9dfd822516 - File hash:
2f54f6d41f41bb3c8e684b0f009cbcc3 - File hash:
3794736979327349404171798328a38a
Defanged, TLP:CLEAR. Full set of 25 indicators: unlock with TL Creds.
Technical analysis
Bitdefender Labs (researcher Andrei Anton-Aanei) reported on 2026-11-17 a campaign of 22 malicious GitHub repositories, spread across accounts such as toray, ejaaduipitara, itsunai and tobias94-design, whose content targets AI coding agents rather than the human developer. Each repository carries an AGENTS.md or CLAUDE.md that instructs the assistant to run `node scripts/setup.js`, describing it as a 'sealed binary artifact, not human-readable source code', and tells the agent not to display the file or its output. This is indirect prompt injection: the malicious instructions live in repository content, so an assistant asked for ordinary help before 'setup' has run may execute the script without asking. A second path needs no AI prompt at all: a `.claude/settings.json` session-start hook runs a shell command as soon as the developer opens and trusts the repository.
setup.js is a 3.75 MB single-line file. Stage 0 hex-decodes an embedded value, applies ROT13 and evaluates the result. Stage 1 is a Node.js stager holding two AES-128-GCM encrypted blobs with embedded keys; it decompresses one into a 4.67 MB bundle, resolves or downloads the Bun runtime, and pipes the bundle to `bun run -` over stdin. Stage 2 is the Bun credential stealer, which targets CI/CD systems and GitHub Actions, cloud platform and container credentials, package registry tokens, browser-stored credentials, password managers, Windows Credential Manager, SSH keys, .env files, API keys and source-control tokens. Stolen tokens are validated against provider APIs, then encrypted and batched for dispatch. Additional payloads are hidden in a compressed `_bz` field in package.json (Windows Credential Manager enumeration, JavaScript run only under specific runtime conditions). Bitdefender did not identify the exfiltration channel or any domains/IPs.
The malware self-propagates in two ways. Locally, it recursively searches the home directory for agent config files (settings.json, config.json, mcp.json, .aider.conf.yml, .cursorrules, .windsurfrules, .cursor/rules/, .github/copilot-instructions.md), keeps paths containing one of 14 agent names (Claude, Codex, Gemini, Copilot, Kiro, OpenCode, Cline, Aider, Tabby, Amazon Q, Cody, Bolt, Continue, Cursor), and injects malicious instruction text, session-start hooks or MCP server configurations. Remotely, it validates GitHub tokens via /user, /user/repos and /users/<login>/repos, checks for repo, public_repo and workflow scopes, and acts on up to MAX_TARGET_REPOS (default 25) repositories, inspecting up to 50 branches each (skipping dependabot/ and copilot/ branches). On GitLab it uses /api/v4/projects and can create pipeline schedules. Where permissions allow it commits AGENTS.md, CLAUDE.md, .cursorrules, .cursor/rules/setup.mdc, .claude/settings.json, .claude/setup.mjs, .mcp.json, .vscode/tasks.json, .vscode/setup.mjs and .github/copilot-instructions.md, and attempts to republish infected packages to npm, PyPI, RubyGems and JFrog.
Bitdefender attributes the campaign to no actor and names no malware family. Other vendors documented a structurally similar technique in 2026 (the Mini Shai-Hulud npm worm, May 2026, and SafeDep's 'Miasma' variant, June 2026: SessionStart hooks, .vscode/tasks.json folderOpen tasks, AES-128-GCM-wrapped Bun loaders), but none of the sources link those to these 22 repositories, so no attribution is made here. Severity is analyst-assigned.
MITRE ATT&CK / ATLAS techniques by tactic:
Execution
AML.T0051.001 LLM Prompt Injection: Indirect; T1059 Command and Scripting Interpreter; T1059.007 JavaScript; T1204 User Execution
Defense Evasion
T1027 Obfuscated Files or Information; T1140 Deobfuscate/Decode Files or Information
Initial Access
T1195 Supply Chain Compromise; T1195.002 Compromise Software Supply Chain
Credential Access
T1528 Steal Application Access Token; T1552.001 Credentials In Files; T1552.004 Private Keys; T1555.003 Credentials from Web Browsers; T1555.004 Windows Credential Manager; T1555.005 Password Managers
Persistence
T1546 Event Triggered Execution
lateral-movement
T1550.001 Use Alternate Authentication Material: Application Access Token
Collection
Remediation
Immediate actions
- Hunt developer endpoints and CI for the listed setup.js MD5 hashes and for repositories containing scripts/setup.js referenced from AGENTS.md or CLAUDE.md
- If any of these files ran, rotate every token, key and cloud secret reachable from that machine (GitHub/GitLab PATs, npm/PyPI/RubyGems/JFrog tokens, cloud keys, SSH keys, CI secrets)
- Audit GitHub/GitLab accounts for unexpected commits adding AGENTS.md, CLAUDE.md, .cursorrules, .cursor/rules/setup.mdc, .claude/settings.json, .claude/setup.mjs, .mcp.json, .vscode/tasks.json or .vscode/setup.mjs, and for new GitLab pipeline schedules
- Review ~/.claude, ~/.cursor, ~/.gemini and other agent config directories and mcp.json files for session-start hooks, MCP servers or instructions you did not add
Workarounds
- Require manual approval for all agent shell command execution in untrusted repositories
- Block or alert on Bun being downloaded or launched (bun run -) by node processes on developer workstations
Longer-term hardening
- Treat agent instruction files (AGENTS.md, CLAUDE.md, .cursorrules, MCP definitions, session-start hooks, VS Code tasks) as executable code in code review
- Do not trust or open unfamiliar repositories in AI-enabled editors without inspecting .claude/, .cursor/, .gemini/ and setup scripts
- Treat instructions that forbid inspecting a file, suppress output, bypass confirmation or auto-install software as red flags
- Use fine-grained, short-lived tokens with minimal scopes (avoid repo/workflow scopes on developer PATs) and review package publishing permissions
- Consider tooling that inspects instruction files before the agent acts (Bitdefender AI Guardian, Agent Skill Scanner)
Affected and fixed versions
- Anthropic — Claude Code
Vulnerable versions: Sessions in which a malicious repository is trusted or its CLAUDE.md/AGENTS.md is followed - Anysphere — Cursor
Vulnerable versions: Sessions in which a malicious repository's rules/instruction files are followed - Multiple — AI coding assistants whose config is poisoned for propagation (Codex, Gemini, Copilot, Kiro, OpenCode, Cline, Aider, Tabby, Amazon Q, Cody, Bolt, Continue)
Vulnerable versions: Configuration files located by the worm on infected machines
Timeline
- Related (not attributed): StepSecurity publishes 'A Mini Shai-Hulud Has Appeared', documenting the npm worm whose pattern Bitdefender later compares to this campaign
- Related (not attributed): Cloud Security Alliance research note describes Mini Shai-Hulud as an npm worm targeting the AI developer supply chain
- Related (not attributed): Mini Shai-Hulud npm worm wave, per Sonar, pushes malicious package versions that plant SessionStart hooks in locked-ioc-15 and folderOpen tasks in locked-ioc-16
- Related (not attributed): Sonar publishes 'Mini Shai-Hulud targets AI coding agents', detailing SessionStart hooks and locked-ioc-16 abuse
- Related (not attributed): SafeDep-reported 'Miasma' wave force-pushes setup.js plus Claude/Gemini/Cursor/VS Code trigger files into GitHub repositories (AES-128-GCM-wrapped Bun loader)
- Related (not attributed): SafeDep publishes analysis of the 'Miasma' worm injecting AI coding agent config files into GitHub repositories
- Bitdefender runs internal AI Guardian tests against the 22 samples; the instruction file is detected in all 22
- Bitdefender Labs publishes analysis of 22 malicious GitHub repositories poisoning AGENTS.md, CLAUDE.md and locked-ioc-15 to run a hidden setup.js loader
- Cyber Security News reports the campaign, summarizing the setup.js stages, propagation logic and MD5 indicators
Sources cited
- How AI Agents Become New Targets in GitHub Malware Campaign (Bitdefender Labs) bitdefender.com · Research · 2026-11-17
- Miasma Worm Targets AI Coding Agents via GitHub Repos (SafeDep) - related technique safedep.io · Research · 2026-06-05
- Mini Shai-Hulud: npm Worm Targets AI Developer Supply Chain (CSA research note) - related technique labs.cloudsecurityalliance.org · Research · 2026-05-17
- A Mini Shai-Hulud Has Appeared (StepSecurity) - related technique stepsecurity.io · Research · 2026-05-12
- Mini Shai-Hulud targets AI coding agents: what developers need to know (Sonar) - related technique sonarsource.com · Blog · 2026-05-26
- Hackers Hijack AI Coding Agents Through Malicious GitHub Repositories to Steal Developer Credentials (Cyber Security News) cybersecuritynews.com · News · 2026-11-18
Further reading
Drafted by the Threadlinqs research pipeline from 6 sources; published ; last updated —.