[BUG] Permissions Bypass
Resolved 💬 2 comments Opened Jun 16, 2025 by KaiZenSpace Closed Jun 23, 2025
Bug Report: Permissions Bypass in Claude Code
Summary
Claude Code fails to respect file access permissions defined in .claude/settings.local.json, allowing access to files explicitly listed in the deny array.
Steps to Reproduce
- Create a
.claude/settings.local.jsonfile with the following content:
{
"permissions": {
"allow": [],
"deny": ["./.env"]
}
}
- Create a
.envfile in the project root - Use Claude Code's Read tool to access the
.envfile - Claude Code successfully reads the file despite it being in the deny list
- The
/permissionscommand correctly shows the permission settings - Testing with absolute path also fails to block access
Expected Behavior
Claude Code should refuse access to ./.env and return an error message indicating that the file is denied by permissions.
Actual Behavior
Claude Code successfully reads the contents of ./.env file, bypassing the permission restriction.
Environment
- Platform: Linux 6.8.0-60-generic
- Working directory:
/home/user/Documents/Programmieren/webeditor - Git repo: Yes
- Date: 2025-06-16
Configuration
.claude/settings.local.json:
{
"permissions": {
"allow": [],
"deny": ["./.env"]
}
}
Additional Issues & Improvements
- Both relative and absolute paths fail: Tested with both
./envand absolute path - neither blocks access - Permissions visible but not enforced: The
/permissionscommand shows the correct settings, but they're not enforced - Settings file accessibility: Claude Code can access
./.claude/settings.local.jsonitself, which could be restricted for better UX - User experience: Users expect denied files to be completely inaccessible when explicitly configured
Security Impact
This is a security issue as it allows access to potentially sensitive files (like .env files containing secrets) that users have explicitly denied access to.
Possible Causes
- Permission checking not implemented for Read tool
- Bug in permission enforcement logic
- Path matching issues in deny list processing
I ALSO TRIED TO RESTART CLAUDE CODE
Thank you for understanding.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗