Skip to content
0DIN·Indexed by this site · Originally published· Attacks →

0DIN discloses indirect prompt injection via DNS TXT records against Claude Code to obtain a shell

Clone This Repo and I Own Your Machine

AI summary

0DIN demonstrates an indirect prompt injection attack against Claude Code: an attacker only needs to control a public GitHub repository, without committing any malicious code, to obtain an interactive shell on the machine of a developer who opens that repository. The setup instructions and scripts in the repository appear completely normal; the script pulls configuration from attacker-controlled DNS TXT records via dig and executes it directly, with the record content base64-decoded into a reverse shell. Claude Code reads project files, installs dependencies, encounters a RuntimeError, and then runs the init command as suggested by the error, completing the entire process autonomously, with the terminal only showing initialization success. The attacker can thereby obtain credentials such as ANTHROPIC_API_KEY, AWS_SECRET_ACCESS_KEY, and GITHUB_TOKEN from the environment, achieve persistence by changing SSH keys, adding cron jobs, or installing backdoors, and can also modify DNS records at any time to change the payload.

Read original0din.ai