AI Coding Tools Hijacked via Malicious GitHub Repos to Steal Credentials

Developers are facing a rising threat as malicious GitHub repositories are being used to compromise AI-assisted coding tools and steal sensitive credentials. In a campaign uncovered by Bitdefender Labs, at least 22 GitHub links were identified that deliver concealed malware to tools like Claude Code and Cursor via trusted-seeming repository files, allowing attackers to hijack local environments without raising alarm bells.

How the Attack Works

The threat begins with standard-looking files in a project—names like AGENTS.md or CLAUDE.md—which AI coding assistants typically use to learn project context and rules. In this campaign, these files have been modified to instruct the assistant to run a script named setup.js automatically. The script is described in the instructions as a “sealed binary artifact” and is cryptographically signed, purportedly to hide its contents and warrant automatic execution at startup with no further question or visible output—effectively social engineering disguised as dev setup.

Attackers also employ configuration files—such as .claude/settings.json—that include session-start hooks. These allow code execution in the user’s environment without prompting, after initial trust has been established. Once setup.js runs, it acts as a loader: the visible script—a large one-line file—is a wrapper which decodes an encrypted payload using techniques like ROT13 and then launches a large bundle via Bun. The ultimate payload harvests credentials from cloud platforms, password stores, CI/CD pipelines, API tokens, SSH keys, environment files, and more.

Spreading the Infection

After gaining initial access, the malware doesn’t stop. It searches the developer’s system for settings or rules files associated with popular AI agents—like Claude, Codex, Gemini, Copilot, and Cursor—and injects its own instructions or hooks into those files. It also abuses stolen GitHub and GitLab tokens to find repos where it has sufficient permissions—or can gain them—and in some cases, automatically commits malicious files or workflows across branches. Secondary infection avenues include package registries such as npm, PyPI, RubyGems, and JFrog.

Researchers have flagged indicators of compromise—specific repositories and a matching setup.js MD5 signature—so that defenders can detect these threats. Bitdefender’s internal tool, AI Guardian, caught all 22 samples during tests run on November 10. However, there’s concern new variants could evade current detection.

Security experts recommend several defenses: review unfamiliar or third-party repos before opening them in AI tools; examine files such as AGENTS.md, CLAUDE.md, or agent settings folders; scrutinize session-start hooks, setup scripts, and anything labeled as “sealed” or “do not inspect”. If you’ve used a compromised repo, it’s crucial to rotate any keys, tokens, or secrets the project could reach.

This attack represents an evolution of indirect prompt injection—where harmful instructions are embedded in material AI systems read—paired with configuration-based auto-execution. It highlights that as AI assistants grow more capable, the chain of trust within software development must be tightened; mechanisms assumed safe by default are being weaponized.