Security researchers at Apiiro have uncovered a significant leak of sensitive information on public GitHub instances, thanks to an oversight in the way Claude Code handles user approval for automated shell commands. The issue arises when users opt to run a command without further confirmation, causing sensitive data, such as database passwords and API tokens, to be stored in the local .claude/settings.local.json file, which can be accidentally shared on GitHub repositories.
While the .gitignore setting usually prevents such files from being publicly shared, this setting isn't always applied at the repository level, leading to the accidental upload of sensitive information. In some cases, Claude Code itself will commit changes to the settings file without user input, exacerbating the risk of data exposure.
Apiiro’s researchers identified over 100,000 instances where Claude Code’s local settings file had been uploaded to public GitHub repositories. Although the majority of these repositories did not contain secrets, some 1,100 from 63 different organizations did. Even after these files are discovered and removed, the secrets may persist in forks of the original project, highlighting the ongoing challenge of securing sensitive data in collaborative environments.
The issue underscores the importance of thorough security checks and regular audits in AI development, especially when handling sensitive data. Users, developers, and organizations must remain vigilant to avoid similar oversights in the future.







