-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed as not planned
Labels
area:corearea:securityautocloseIssue will be closed automaticallyIssue will be closed automaticallybugSomething isn't workingSomething isn't workinghas reproHas detailed reproduction stepsHas detailed reproduction steps
Description
Description
During a coding session, I asked Claude Code to save/document Azure OpenAI configuration. Instead of using environment variables in the examples, Claude Code hardcoded the actual API key directly in a markdown documentation file (AZURE_OPENAI_CURL_REFERENCE.md).
What happened
- I was integrating Azure OpenAI into my project
- I asked Claude to create documentation with curl examples
- Claude created the file with my actual API key hardcoded:
export AZURE_API_KEY="2a48df168ba44526a8f3cf71ae280d3f" # Real key!
- I committed and pushed without noticing (my fault for not reviewing)
- The key was exposed in a public repo for 11 days
- Hackers found it and used $30,000 USD worth of API calls
Expected behavior
Claude Code should NEVER hardcode actual API keys in any file. It should always use:
- Placeholder values:
your-api-key-here - Environment variable references:
$AZURE_API_KEY - Or at minimum, warn the user about the security risk
Suggested improvements
- Add a safety check that detects when Claude is about to write something that looks like an API key
- Always use placeholders in documentation examples
- Warn users before committing files that contain potential secrets
Impact
- $30,000 USD fraudulent charges
- Lost employment
Commit reference
f3ac3f6 - "feat: Integrate Azure OpenAI as LLM provider alongside Claude and Ollama"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:corearea:securityautocloseIssue will be closed automaticallyIssue will be closed automaticallybugSomething isn't workingSomething isn't workinghas reproHas detailed reproduction stepsHas detailed reproduction steps