AIToday
Large Language ModelsAI Coding AssistantsTHE DECODERPublished: Jun 29, 2026, 22:00 JST2 min read

AI Coding Tools Can Run Hidden Malware From GitHub Repos

AI Coding Tools Can Run Hidden Malware From GitHub Repos

Key takeaway

  • Security researchers discovered a new attack vector where AI coding assistants like Claude Code can be tricked into running hidden malware from seemingly legitimate GitHub repositories.

  • The attack exploits indirect prompt injection—malicious code is pulled from a DNS entry at runtime and executes automatically when the AI encounters a setup error, giving attackers reverse shell access to steal credentials and maintain persistence.

  • The vulnerability underscores a significant risk for developers who use AI coding tools on untrusted third-party code.

3 Key Points

  1. What happened

    Security researchers at 0DIN found that attackers can compromise developers' machines through GitHub repositories using indirect prompt injection. A setup script in a repo pulls commands from a DNS entry at runtime and executes them invisibly—Claude Code hits a routine error, automatically runs the script, and opens a reverse shell giving attackers full control.

  2. Why it matters

    The malicious code never exists in the repository itself, making it invisible to scanners, code reviews, and the AI agent. Once an attacker gains access, they can steal API keys and login credentials and maintain persistent access. A single repo link shared in a job posting, tutorial, or Slack message is enough to compromise anyone who opens it with an AI coding tool.

  3. What to watch

    The researchers recommend that AI agents should display what is in a setup script before running it, and developers should treat setup instructions in third-party repos as untrusted code.

Ask the AI about this article →

FAQ

How does the attack work without visible code in the repository?
A setup script in the repo pulls a command from a DNS entry at runtime and executes it. Because the malicious code is fetched dynamically rather than stored in the repository, it remains invisible to scanners, code reviews, and the AI agent until it runs.
What can an attacker do once they gain access?
Once the reverse shell is opened, the attacker can grab API keys and login credentials from the developer's machine and maintain persistent access.
What is the recommended fix?
AI agents should display what is in a setup script before running it, and developers should treat setup instructions in third-party repositories as untrusted code.

Get the latest Large Language Models news every morning

AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.

Free · takes 30 seconds · unsubscribe anytime

Ask AI

Ask AI anything about this article. Q&As are published on this page for other readers too.

Related Articles

Next articleOpen-source AI emerges as middle-power answer to Big Tech control