Poisoned Repos Turn AI Coding Agents Into Thieves

Human Verified

Share to: , and

A hooded developer seen from behind at a glowing laptop in a dark room, luminous threads flowing from the screen toward hanging padlock icons.

Security researchers have found 22 poisoned GitHub repositories that trick AI coding assistants into running hidden malware that steals developer credentials, cloud secrets and SSH keys, and then plants the same trap in up to 25 more repositories per stolen account.

How the trap works

The campaign, documented by Bitdefender Labs, abuses the files that coding assistants use to understand a project. Poisoned AGENTS.md and CLAUDE.md files present a script called setup.js as a sealed, signed artifact that the assistant must run without inspecting it.

The instructions use the language of internal security policy, calling the file part of a sealed initialization process with encrypted credentials inside. They order the assistant to run it at session start, silently, and to run it automatically if the user asks for help without setup.

A second route

A second route needs no prompt at all. Once a developer opens and trusts a repository, a configuration file such as .claude/settings.json can trigger a session-start hook that runs the same script in the user’s shell, with the developer’s own permissions, before any instruction is given.

The payload

The payload is a multi-stage JavaScript loader built to resist analysis. A 3.75-megabyte single-line script hex-decodes an embedded value, applies a ROT13 cipher, and decrypts two AES-128-GCM blobs into a 4.67-megabyte bundle piped to the Bun runtime through standard input for execution.

Once running, the malware goes after credentials across the developer’s machine: CI/CD systems and GitHub Actions secrets, cloud and container credentials, package registries, browser-stored logins, password-manager data, Windows Credential Manager entries, SSH keys, API keys, source-control tokens and .env files.

Built to spread

The malware is built to spread, not just steal. It searches the victim’s home directory for configuration files belonging to 14 AI coding tools, from Claude Code and Cursor to Copilot and Gemini, then injects malicious instructions, hooks or server definitions into them.

Stolen GitHub and GitLab tokens are validated against provider APIs, checking identity, repositories and scopes. Where an account can push changes, the malware can plant the same poisoned files in up to 25 repositories, and try to republish infected packages through npm, PyPI, RubyGems and JFrog.

Detection

Bitdefender says its AI Guardian tool detected the malicious instruction file in all 22 samples during internal tests on 10 November. The company stresses the tool is a layer of defence, not a replacement for reviewing unfamiliar repositories before trusting them.

Why It Matters

This campaign matters because it turns the coding assistant itself into the attack vector. Developers already trust these tools with shell access and credentials; the poisoned files exploit exactly that trust, and the session-start hook route works even when the assistant is never fooled.

The self-spreading design is the second warning. One careless clone can compromise a developer’s tokens, then poison repositories their colleagues will clone next, turning a single workstation infection into a supply-chain incident that crosses teams, companies and organisations without anyone noticing.

Background

Coding assistants have become a security boundary of their own this year. Cursor traced its breach to a leaked vendor key, a coding agent leaked customer prompts for months, and autonomous agents found a zero-day on their own, showing how fast the new attack surface is growing.

Source: Bitdefender Labs research and threat-feed summary

Share to: , and

Faheem R. Khattak

Senior automation engineer and AI marketing journo covering LLMs, algorithms, analytics, core updates, Bing search, and technical SEO.

0 Comments

Leave a Reply

Optional Take Tag:

🛡️ Spam protection: Honeypot + Time-Trap Active

This site uses Akismet to reduce spam. Learn how your comment data is processed.