$ techbeacon▋
Phishing

Anthropic’s Claude Code Leaves Thousands of Secrets Exposed in Public GitHub Repos

Anthropic’s Claude Code Leaves Thousands of Secrets Exposed in Public GitHub Repos

Anthropic’s AI‑driven coding assistant, Claude Code, has unintentionally deposited sensitive credentials into more than a thousand publicly accessible GitHub repositories, according to a report first published by The Hacker News. The exposure stems from a feature that lets users confirm a command and select “Yes, and don’t ask again,” which causes the assistant to store the exact command line—including any passwords or API keys typed—without further prompts.

Security analysts found that the stored commands were later committed to public forks of the original projects, resulting in 1,122 distinct copies of the same secret‑laden snippets scattered across GitHub. Because these repositories are open, anyone can view the exposed data, turning routine development operations into a potential vector for credential theft.

The incident highlights a broader challenge for AI‑assisted development tools that aim to streamline coding tasks by remembering user preferences. While the “don’t ask again” option is intended to reduce friction, it can also preserve raw input that may contain confidential information. When that input is automatically saved and later pushed to version control without proper sanitization, the risk of leaking secrets multiplies.

Developers using Claude Code—or similar assistants—are now being urged to audit their repositories for inadvertent disclosures and to rotate any compromised keys or passwords immediately. GitHub’s own secret‑scanning mechanisms can flag known patterns, but they are not a substitute for disciplined secret management practices such as using environment variables, secret‑management services, or dedicated credential‑injection tools.

Anthropic has not released a detailed response at the time of writing, but industry observers expect the company to update its handling of command histories, possibly adding automatic redaction of credential‑like strings or prompting users before persisting commands that appear to contain sensitive data. The episode serves as a reminder that the convenience offered by generative AI must be balanced with robust security controls.

As AI becomes more embedded in software development workflows, the incident underscores the need for clear guidelines and safeguards around data retention. Organizations are likely to revisit policies governing the use of AI assistants, emphasizing training for developers on the risks of embedding secrets in code and encouraging the adoption of tools that automatically detect and block credential leakage before code reaches public repositories.

Arjun Pratap Rana — Arjun reports on data breaches and corporate security incidents, focusing on how leaks happen and what they mean for affected users. Verifies claims against HaveIBeenPwned and leak listings.

Comments (0)

Be the first to comment.

Join the discussion

Protected by reCAPTCHA v3

Related