Bitdefender: 22 poisoned GitHub repos abuse AGENTS.md, CLAUDE.md and SessionStart hooks to make AI coding agents run setup.js stealer
Matéria consolidada. Reúne 2 matérias que o Tifon tinha publicado separadamente sobre a mesma história. A IA reescreveu o relatório com o que as 2 fontes trouxeram em 19/11/2026 12:03; os links antigos trazem para cá.
Fontes: securityonline.info ↗ gbhackers.com ↗
Bitdefender Labs researcher Andrei Anton-Aanei identified a campaign targeting developers who use AI coding assistants, built on 22 malicious GitHub links/repositories (gbhackers.com, securityonline.info). Poisoned instruction files (AGENTS.md, CLAUDE.md) present a hidden multistage JavaScript loader (setup.js, in scripts/setup.js) as a signed or compliance-related initialization step and tell the agent to run it without review. A second route uses a SessionStart hook in .claude/settings.json to run the payload without relying on the model's judgment or any prompt. The payload steals source-control, cloud, CI/CD, package-registry and browser secrets, and spreads by tampering with the configurations of 14 local AI tools and by pushing poisoned content to other repositories. Neither source reports a CVE, a named threat actor, attribution to a known group, or a victim count. Both articles are based on Bitdefender's report; the sources reviewed here did not include a vendor advisory or the IOCs themselves.
Detalhes técnicos
- Lure: Markdown files use DevSecOps and SOC-2 compliance pretexts to instruct the assistant to run
node scripts/setup.jswithout asking for confirmation (securityonline.info). - Hook route:
.claude/settings.jsondefines a SessionStart hook, so execution needs no model decision (securityonline.info, gbhackers.com). In interactive Claude Code sessions this depends on workspace trust. Per Anthropic's documentation, noninteractive and SDK sessions do not show the same trust prompt (gbhackers.com). - Obfuscation: setup.js is a 3.75 MB single-line script, hex-decoded and then ROT13-decoded. It launches a Node.js stager that decrypts one of two AES-128-GCM blobs into a 4.67 MB bundle (securityonline.info).
- Execution: The stager finds or downloads the Bun runtime and pipes the payload into
bun runvia stdin. Windows Credential Manager modules are hidden in a compressed_bzfield in package.json (securityonline.info). - Collection: Source-control tokens, cloud secrets, CI/CD and GitHub Actions credentials, container platforms, package registry tokens, SSH keys, .env files, browser data and password manager information. Tokens are validated against provider APIs and then encrypted for exfiltration (gbhackers.com, securityonline.info).
- Local spread and persistence: Rogue instructions, hooks or MCP server definitions are injected into the configs of Claude, Codex, Gemini, Copilot, Kiro, OpenCode, Cline, Aider, Tabby, Amazon Q, Cody, Bolt, Continue and Cursor (securityonline.info; gbhackers.com confirms 14 tools).
- Remote spread: Stolen GitHub and GitLab tokens are used to inspect up to 50 branches across up to 25 repositories and commit poisoned agent files or alter workflows. The malware also tries to republish infected packages to npm, PyPI, RubyGems and JFrog (securityonline.info, gbhackers.com).
- Detection: Bitdefender says its AI Guardian detected the malicious instruction file in all 22 samples in internal testing on November 10. This does not establish coverage of every hook-based path or future variant (gbhackers.com).
Remediação
- Do not trust unfamiliar repositories before inspecting them. Review agent instructions, startup hooks, MCP definitions and editor tasks first, and give changes to these files the same scrutiny as CI workflows and dependency updates (gbhackers.com, securityonline.info).
- Audit AGENTS.md, CLAUDE.md, .cursorrules, .claude/settings.json, .mcp.json and .vscode/tasks.json for commands that run setup scripts, suppress output or forbid inspection (securityonline.info).
- Use enforceable controls such as permission rules and sandboxing instead of relying on model instructions (gbhackers.com).
- If execution is suspected, isolate the workstation, clean all local AI configuration directories, and revoke and rotate all GitHub, GitLab, cloud and package-registry credentials from a clean system. Then audit commits, workflow changes and package releases made with the affected credentials (gbhackers.com, securityonline.info).
- Bitdefender's original report provides sample hashes for responders (gbhackers.com).
Relatos divergentes
- The sources do not contradict each other on facts, but they differ in framing. securityonline.info (the later source, November 19) describes the payload as a credential-stealing worm that pushes poisoned commits to up to 25 remote repositories. gbhackers.com (November 18) stresses that the remote spread and package republishing are capabilities documented in the payload, not proof that every targeted repository or registry was compromised. Treat the spread behavior as demonstrated capability rather than confirmed impact.
Linha do tempo
-
Bitdefender: 22 poisoned GitHub repos use AGENTS.md and SessionStart hooks to make AI coding assistants run a credential-stealing worm
ler a análise desta fonte ocultar
Bitdefender Labs researcher Andrei Anton-Aanei reported a campaign of 22 poisoned GitHub repositories that abuse AI coding assistants to run a multi-stage loader (scripts/setup.js) on developer workstations. Poisoned instruction files (AGENTS.md, CLAUDE.md) and a SessionStart hook in .claude/settings.json trigger execution, the latter without any prompt. The payload steals cloud, CI/CD, repository, package-registry and browser secrets. It infects configuration files of 14 local AI tools and pushes poisoned commits to up to 25 remote repositories. No attribution to a known group was made, and no victim count was disclosed. This summary is based on the article alone; no web research was done, so no vendor advisory or IOCs were checked.
Technical Details
- Markdown files use DevSecOps and SOC-2 compliance pretexts to tell the assistant to run
node scripts/setup.jswithout asking for confirmation. - Settings files such as
.claude/settings.jsondefine a SessionStart hook, so execution needs no prompt. - setup.js is a 3.75 MB single-line script. It is hex-decoded and ROT13-decoded, then launches a Node.js stager that decrypts one of two AES-128-GCM blobs into a 4.67 MB bundle.
- The stager finds or downloads the Bun runtime and pipes the payload into
bun runvia stdin. Windows Credential Manager modules are hidden in a compressed_bzfield in package.json. - Secrets are harvested from CI/CD, GitHub Actions, cloud and container platforms, registries, browsers, password managers, .env files and SSH keys. Tokens are validated against provider APIs, then encrypted for exfiltration.
- Local spread: rogue instructions, hooks or MCP settings are injected into the configs of Claude, Codex, Gemini, Copilot, Kiro, OpenCode, Cline, Aider, Tabby, Amazon Q, Cody, Bolt, Continue and Cursor.
- Remote spread: stolen GitHub and GitLab tokens are used to inspect up to 50 branches across 25 repositories and commit poisoned agent files. The malware also tries to republish infected packages to npm, PyPI, RubyGems and JFrog.
Remediation
- Do not trust unfamiliar repositories before inspecting them.
- Audit AGENTS.md, CLAUDE.md, .cursorrules, .claude/settings.json, .mcp.json and .vscode/tasks.json for commands that run setup scripts, suppress output or forbid inspection.
- If the loader ran, clean all local AI configuration directories and rotate all GitHub, GitLab, cloud and package-registry credentials.
- Markdown files use DevSecOps and SOC-2 compliance pretexts to tell the assistant to run
-
Malware campaign abuses AGENTS.md, CLAUDE.md and session-start hooks to run setup.js loader on developers using AI coding agents
ler a análise desta fonte ocultar
Bitdefender Labs researcher Andrei Anton-Aanei identified a campaign that targets developers who use AI coding assistants. It uses compromised GitHub content, with 22 malicious links to files built to launch a concealed JavaScript payload (setup.js). Instruction files such as AGENTS.md and CLAUDE.md present setup.js as a signed initialization artifact and urge silent execution without review. A second route uses a session-start hook in project settings to run the payload without relying on the model's judgment. The article reports no CVE and no named threat actor. Only the article was used; no web research was done.
Technical Details
- setup.js is a multistage loader that hides its payload with encoding, encryption and compression.
- It collects source-control tokens, cloud secrets, CI/CD credentials, package registry tokens, SSH keys, browser data and password manager information. It also validates stolen tokens against provider APIs.
- It searches the home directory for configurations of 14 coding tools, including Claude, Codex, Copilot and Cursor. It can tamper with their instructions, hooks and MCP server definitions, which creates persistence on the workstation.
- With stolen GitHub or GitLab credentials it can plant malicious configurations in other repositories and alter workflows. It can also try to republish infected packages through npm, PyPI, RubyGems or JFrog. These are capabilities documented in the payload, not proof that every targeted repository or registry was compromised.
- In interactive Claude Code sessions, the hook route depends on workspace trust. Per Anthropic's documentation, noninteractive and SDK sessions do not show the same trust prompt.
- Bitdefender says its AI Guardian detected the malicious instruction file in all 22 samples in internal testing on November 10. This does not establish coverage for every hook-based path or future variant.
Remediation
- Review agent instructions, startup hooks, MCP definitions and editor tasks before trusting an unfamiliar workspace. Give changes to these files the same scrutiny as CI workflows and dependency updates.
- If execution is suspected, isolate the workstation and revoke exposed tokens from a clean system. Then audit commits, workflow changes and package releases made with the affected credentials.
- Use enforceable controls such as permission rules and sandboxing instead of relying on model instructions.
- Bitdefender's original report provides sample hashes for responders.