Skip to content

[BUG] Claude Code can access denied files #4768

Closed as not planned
Closed as not planned

Description

@dommueller

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
  • Claude CLI version: 1.0.63
  • Operating System: macOS 15.5
  • Terminal: Terminal App

Bug Description

I setup my .claude/settings.json to deny Read access to the credentials folder:

{
  "permissions": {
    "deny": [
      "Read(credentials/**)"
    ]
  }
}

However, Claude code is able to show me the contents of the file if asked.

Image

Steps to Reproduce

  1. Create secret file inside folder
  2. Add rule to disallow access
  3. Ask for contents of the file

Expected Behavior

Claude Code is blocked accessing the file. According to the documentation, this should deny access to all files inside the credentials folder.

Image

Actual Behavior

Claude Code prints out contents of file

Additional Context

I asked Claude Code, which mentioned that it could be due to total vs relative paths, but even adding **/credentials/** didn't work.

Activity

  1. dommueller commented on Jul 30, 2025

    @dommueller
    Author

    It seems like this is related to using @ which invokes the Read <file> tool which is not bound by the rules of Read(<file>). However, even if the user asks specifically for a file, I'm not sure it should be possible to read it if it is denied (e.g. by company policy).

    Furthermore, I have a feature request to disallow file paths independent of Tool. As currently Claude Code could just use Bash(cat <file>) to get to the contents (or a variation of that).

  2. github-actions commented on Aug 8, 2025

    @github-actions

    Found 3 possible duplicate issues:

    1. [BUG] TClaude Code ignores file access restrictions in settings.json #3501
    2. [BUG] Permissions Bypass #2162
    3. Permissions Configuration Bypass in Local Settings Enforcement #2720

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  3. DollarAkshay commented on Aug 8, 2025

    @DollarAkshay

    ....As currently Claude Code could just use Bash(cat <file>) to get to the contents (or a variation of that).

    To make things worse Bash(*:*) or Bash(*) which should disable all bash commands also doesnt work.

  4. github-actions commented on Dec 3, 2025

    @github-actions

    This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

  5. shaken1901 commented on Dec 4, 2025

    @shaken1901

    This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

    Still observing this behavior in claude 2.0.58 as of today - please don't close this unassigned permissions issue via automation due to lack activity. It is important for trustworthiness that the permissions system behave as documented.

  6. github-actions commented on Jan 7, 2026

    @github-actions

    This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

  7. kozmic commented on Jan 7, 2026

    @kozmic

    Please re-open this issue, as this is an important security control that is not working as documented.

  8. github-actions commented on Jan 17, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  9. locked as resolved and limited conversation to collaborators on Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions