Cyber News
Com-Affiliated Hackers Exploit Vishing and MFA to Hijack Cloud Accounts and Steal Corporate Data
Vishing

Artificial Intelligence / Developer Security

A security investigation by software security company Apiiro has revealed that Claude Code's “Yes, and don't ask again” permission feature can unintentionally expose developer passwords, API keys, database credentials, and SSH credentials in public GitHub repositories.
When developers approve a shell command using this option, Claude Code may save the exact command in the project-level file:
.claude/settings.local.json
If the command contains a hardcoded password, token, or API key, the sensitive value can be stored in plain text.
Apiiro identified 1,122 public copies of this file containing at least one secret, representing 1,379 different secrets. The investigation also identified exposed credentials in Git history, repository forks, and shared Claude Code settings files.
The issue highlights how AI coding assistants can unintentionally create new secret-exposure risks through permission management and command approval workflows.
Key findings:
104,185 copies of .claude/settings.local.json were identified across 103,617 public GitHub repositories.
1,122 copies contained at least one secret.
1,379 different secrets were identified in those files.
Exposed credentials included database passwords, SSH logins, GitHub/GitLab/npm tokens, and AWS keys.
Git history and repository forks can preserve secrets even after files are deleted.
Common secret-scanning tools failed to detect some of the exposed credentials.
Claude Code normally requests user approval before executing most shell commands.
When a developer selects “Yes, and don't ask again,” Claude Code saves an allow rule in the project's local settings file:
.claude/settings.local.jsonThe purpose is to allow matching commands to execute in future sessions without repeatedly requesting approval.
However, when the approved command contains a hardcoded secret, Claude Code may save the entire command, including the sensitive value, in plain text.
For example, a developer might approve a command containing a database password:
PGPASSWORD='ExamplePassword123' psql -h db.example.com -U adminThe permission rule may retain the complete command rather than only the command structure.
Consequently, passwords and tokens can become part of a project configuration file. If that file is accidentally committed to a public repository, anyone can potentially access the exposed credentials.
Claude Code attempts to prevent accidental commits by adding .claude/settings.local.json to the developer's global Git excludes file.
This means Git ignores the file on that particular computer across repositories.
However, this protection has important limitations:
Global Git exclusions are local to an individual developer's machine.
The file is not automatically added to the project's own .gitignore.
Existing tracked files are not automatically removed.
Previously committed copies remain accessible through Git history.
Repository forks can preserve copies even after the original repository is cleaned.
Apiiro found that in 539 of the 1,105 repositories it traced, a commit listing Claude as a co-author modified the settings file. This suggests that Claude Code itself frequently contributed to commits containing the file.
Apiiro's investigation identified a substantial number of exposed configuration files and credentials across public GitHub repositories.
| Finding | Reported quantity |
|---|---|
Public copies of .claude/settings.local.json | 104,185 |
| Public GitHub repositories containing copies | 103,617 |
| Files containing at least one secret | 1,122 |
| Different secrets identified | 1,379 |
| Organizations represented | 63 |
| Older Git-history secrets | 734 |
| Repositories containing older secrets | 509 |
| Forks carrying the same secrets | 211 |
| Repositories represented by those forks | 74 |
The exposed credentials included:
379 database passwords.
43 SSH logins for public servers.
42 GitHub, GitLab, and npm tokens.
23 AWS keys.
Researchers also identified high-impact examples, including a database vendor's administrative cloud key and the owner password of a medical-records database.
According to Apiiro, every file containing a secret was still present on its repository's default branch at the time of its Monday review. In half of those repositories, the file had been present for at least 217 days.
The investigation also identified 2,539 secrets across 1,994 repositories when older file versions, shared settings files, and saved agent chat logs were included.
These findings demonstrate that deleting the current configuration file does not necessarily eliminate the exposure.
The issue is not limited to .claude/settings.local.json.
Apiiro also identified secrets in:
.claude/settings.json
Older versions of configuration files in Git history.
Saved AI agent chat logs.
Repository forks.
Developer archives and other project artefacts.
The researchers noted that similar agent-related directories and files should be treated as potentially sensitive, including:
.claude/
.cursor/
.gemini/
.specstory/
These locations may contain commands, conversation history, configuration details, and credentials.
The exposure risk can extend beyond GitHub. Such files may also be included in npm packages, Docker images, ZIP archives, or synchronized folders.
Apiiro tested Gitleaks and TruffleHog against the identified files.
| Secret scanning tool | Files flagged |
|---|---|
| Gitleaks | 564 |
| TruffleHog | 643 |
| Missed by both tools | 215 |
A significant reason for these missed detections is that conventional secret scanners often rely on known credential formats or recognizable patterns.
For example, a password embedded in a command such as:
PGPASSWORD=examplepasswordor:
sshpass -p examplepasswordmay resemble an ordinary string rather than a recognizable API key or token.
This creates a detection gap: credentials can be exposed even when automated secret scanning is enabled.
The findings reinforce the need for secret-scanning rules that inspect command arguments and configuration files, rather than relying exclusively on known key formats.
The behaviour had reportedly been raised by Claude Code users before Apiiro's investigation.
An earlier GitHub issue, filed on August 11, 2025, described approved commands containing API keys and tokens being stored word-for-word in settings.local.json.
According to the report, an automated bot closed that issue as “not planned” on January 3 after 60 days without activity.
Apiiro also cited three other related reports and stated that the reports had been closed by the same automated bot without a response from Anthropic.
This incident does not involve a specific malware family or attacker infrastructure. The primary investigation focus is exposed configuration files and credentials.
| Indicator | Description |
|---|---|
.claude/settings.local.json | Project-level file that may contain approved commands and embedded secrets |
.claude/settings.json | Shared Claude Code settings file that may contain sensitive permission rules |
.cursor/ | AI coding agent directory to review for sensitive information |
.gemini/ | AI agent directory to review for sensitive information |
.specstory/ | Agent-related directory identified by researchers |
PGPASSWORD= | Example of a database password embedded in a command |
sshpass -p | Example of a password passed directly through a command-line argument |
| Git history | May retain credentials even after the original file is deleted |
These are investigation pivots and potentially sensitive artefacts, not confirmed malicious IOCs.
SOC teams and security engineers should investigate public repositories, developer workstations, CI/CD pipelines, and container artefacts for exposed credentials.
Search across GitHub organizations and internal Git repositories for:
.claude/settings.local.json
.claude/settings.jsonIdentify:
Public repositories containing these files.
Files committed despite being listed in a developer's global Git exclusions.
Configuration files containing hardcoded passwords, tokens, or API keys.
Repositories where AI coding agents have contributed commits.
Deleting a file from the current branch does not remove previously committed versions.
Review the repository history:
git log --all -- .claude/settings.local.jsonInspect historical versions of the file and identify credentials that may have been exposed.
Also investigate:
Deleted configuration files.
Historical commits containing sensitive command arguments.
Forks of affected repositories.
Credentials that were removed from the current branch but remain in previous commits.
Inspect developer environments for potentially sensitive agent directories:
.claude/
.cursor/
.gemini/
.specstory/Look for:
Hardcoded credentials in approved shell commands.
API keys and authentication tokens.
Database connection strings.
SSH usernames and passwords.
Saved agent conversations containing secrets.
Treat these directories as sensitive data locations, similar to .env files.
Run Gitleaks and TruffleHog across repositories and historical Git content.
However, do not rely on these tools alone.
Add detection logic for passwords embedded in command-line arguments, particularly patterns involving:
PGPASSWORD=
sshpass -p
mysql -pReview scanner findings manually and verify whether credentials remain active.
Prioritize credentials associated with publicly accessible infrastructure.
Review:
Database authentication logs.
SSH authentication logs.
AWS CloudTrail activity.
GitHub and GitLab audit logs.
npm account and package publishing activity.
Unusual API usage and authentication events.
Correlate suspicious activity with the time the affected repository or file became publicly accessible.
Rotate exposed credentials first: Change every password, token, and API key that appeared in affected files or their Git history.
Remove tracked configuration files: Use Git to stop tracking local settings files:
git rm --cached .claude/settings.local.jsonAdd project-level exclusions: Include the following in the repository's .gitignore:
.claude/settings.local.jsonInspect local settings: Check the file on the developer's machine, even if it was never committed.
Avoid hardcoded secrets: Reference environment variables or secrets-manager values instead of embedding credentials in commands.
Prefer command patterns: Approve narrowly scoped command patterns rather than exact commands containing sensitive values.
Review Git history: Remove exposed secrets from repository history where appropriate, while remembering that history cleanup does not replace credential rotation.
Treat AI agent directories and memory files as sensitive locations.
Add agent configuration files to pre-commit and CI/CD secret scanning.
Scan Git history, not only the current repository state.
Extend detection logic to identify passwords embedded in shell commands.
Add .claude/settings.local.json to organizational .gitignore templates.
Monitor public repositories for accidental credential exposure.
Prioritize credentials associated with publicly accessible databases and servers.
Review Docker images, npm packages, archives, and synchronized folders for leaked agent configuration files.
SOC Recommendation: Do not assume that a credential is safe simply because it has been deleted from a repository. Identify every historical copy, rotate the affected credential, revoke the previous value, and investigate whether it was accessed while exposed.
Continue reading
Cyber News
Vishing

Cyber News
Identity Theft and Data Extortion

Cyber News
Credentials Compromise

3 entries, most recent posts.
Vishing

Identity Theft and Data Extortion

AI-Assisted Autonomous Intrusions
