A security researcher discovered that Anthropic's Claude Code, specifically version 2.1.233, can access sensitive information from .env files even when they are included in .gitignore. The agent consistently read the .env file in multiple test runs, regardless of whether it was ignored by Git or renamed. The researcher found that only explicit "Read deny" rules and specific hooks reliably prevented Claude Code from accessing this information, highlighting that standard Git practices are insufficient for protecting secrets from AI agents. AI
IMPACT Highlights potential security risks in AI coding assistants and the need for explicit access controls beyond standard development practices.
RANK_REASON Security vulnerability discovered in a specific AI coding assistant.
Read on dev.to — Claude Code tag →
AI-generated summary · Google Gemini · from 1 sources. How we write summaries →