# 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.

- **Published:** 2026-11-18T07:14:55Z
- **Last reviewed:** 2026-11-18T07:14:55Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-6307
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-6307.png
- **ID:** TL-2026-6307
- **Severity:** HIGH
- **Category:** SUPPLY_CHAIN
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 25 (3 shown free below)

## Description

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

- T1195 Supply Chain Compromise
- T1195.002 Compromise Software Supply Chain
- T1204 User Execution
- T1059.007 JavaScript
- AML.T0051.001 LLM Prompt Injection: Indirect
- T1546 Event Triggered Execution
- T1027 Obfuscated Files or Information
- T1140 Deobfuscate/Decode Files or Information
- T1552.001 Credentials In Files
- T1555.003 Credentials from Web Browsers
- T1555.005 Password Managers
- T1555.004 Windows Credential Manager
- T1528 Steal Application Access Token
- T1059 Command and Scripting Interpreter
- T1552.004 Private Keys
- T1550.001 Use Alternate Authentication Material: Application Access Token
- T1560 Archive Collected Data

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**AI Agent Poisoned-Repo Loader - node scripts/setup.js and node to bun 'run -' Stager Chain** (`TL-2026-6307-SPL-001`)

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

```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 count
```

### Microsoft KQL

```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, AgentParent
```

### Sigma

```yaml
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.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- Known setup.js Loader Hashes and 3.75 MB [indicator] Files Written to Endpoints (locked: unlock with TL Creds)
- Developer Token Harvesting via CLI (gh, glab, npm, aws, az, gcloud, git credential) Spawned from node/bun (locked: unlock with TL Creds)
- Token Validation Fan-Out - bun/node Contacting GitHub, GitLab, npm, PyPI, RubyGems and JFrog APIs (locked: unlock with TL Creds)
- Propagated Trigger Scripts ([indicator], [indicator]) Executed by Node or Bun (locked: unlock with TL Creds)
- Local Propagation - User-Level AI Agent Config (settings.json, mcp.json, config.json) Modified by node/bun (locked: unlock with TL Creds)
- Bun Runtime Contacting GitHub/GitLab/PyPI/RubyGems/JFrog APIs (Token Validation and Republish) (locked: unlock with TL Creds)
- Worm Propagation - Agent Instruction and Trigger Files Written by node or bun (locked: unlock with TL Creds)
- Credential Store Enumeration by node/bun Children - Windows Credential Manager, Password Managers, SSH Keys, Browser Stores (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (3 of 25)

Defanged, TLP:CLEAR.

- File hash: `b9a182b646c7fdff68f2ff9dfd822516`
- File hash: `2f54f6d41f41bb3c8e684b0f009cbcc3`
- File hash: `3794736979327349404171798328a38a`

Full set of 25 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [How AI Agents Become New Targets in GitHub Malware Campaign (Bitdefender Labs)](https://www.bitdefender.com/en-us/blog/labs/how-ai-agents-become-new-targets-in-github-malware-campaign)
- [Hackers Hijack AI Coding Agents Through Malicious GitHub Repositories to Steal Developer Credentials (Cyber Security News)](https://cybersecuritynews.com/hackers-hijack-ai-coding-agents/)
- [Miasma Worm Targets AI Coding Agents via GitHub Repos (SafeDep) - related technique](https://safedep.io/miasma-worm-ai-coding-agent-config-injection/)
- [Mini Shai-Hulud targets AI coding agents: what developers need to know (Sonar) - related technique](https://www.sonarsource.com/blog/mini-shai-hulud-targets-ai-coding-agents/)
- [Mini Shai-Hulud: npm Worm Targets AI Developer Supply Chain (CSA research note) - related technique](https://labs.cloudsecurityalliance.org/research/csa-research-note-shai-hulud-ai-supply-chain-20260517-csa-st/)
- [A Mini Shai-Hulud Has Appeared (StepSecurity) - related technique](https://stepsecurity.io/blog/a-mini-shai-hulud-has-appeared)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-6307
