Skip to content

Security Permissions Bypass in Bash File Access Restrictions #6036

Closed as not planned

Description

@unwnu

Bug Description
Bug Report: Claude Code Security Permissions Bypass

Summary:
Security permissions configured in .claude/settings.json can be
bypassed when using indirect file access through Bash
commands, allowing access to restricted files that should be
denied.

Steps to Reproduce:

  1. Configure .claude/settings.json with deny permissions:
    {
    "permissions": {
    "deny": [
    "Read(appsettings)",
    "Edit(appsettings)",
    "Write(appsettings)",
    "Bash(appsettings)"
    ]
    }
    }
  2. Attempt direct file access using Read tool - correctly
    denied
  3. Use indirect Bash commands that access the same restricted
    files:
    - find /path -name "*.json" -exec grep -l "pattern" {} ;
    - grep -A5 -B2 "pattern" /path/to/appsettings.json

Expected Behavior:
All Bash commands accessing files matching the appsettings
pattern should be blocked according to the
"Bash(appsettings)" rule.

Actual Behavior:
Bash commands successfully execute and return content from
restricted files, bypassing the security permissions.

Security Impact:
This allows Claude to access sensitive configuration files
(like database connections, API keys, etc.) that users
explicitly intended to restrict, potentially exposing
confidential information.

Environment:

  • Claude Code CLI
  • Model: claude-opus-4-1-20250805
  • Platform: macOS (Darwin 24.6.0)

Environment Info

  • Platform: darwin
  • Terminal: tmux
  • Version: 1.0.83
  • Feedback ID: 2ba205a2-08b0-49b8-8b5b-29c6ab956cd5

Activity

  1. github-actions commented on Aug 18, 2025

    @github-actions

    Found 3 possible duplicate issues:

    1. Security Vulnerability: Bash Permission Bypass via Command Chaining #4956
    2. [BUG] TClaude Code ignores file access restrictions in settings.json #3501
    3. [BUG] Claude Code can access denied files #4768

    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

  2. aspiers commented on Aug 18, 2025

    @aspiers

    #4956 is not a duplicate because the find and grep examples given don't require command chaining.
    #3501 and #4768 are not duplicates because they're about deny not working as documented.

  3. github-actions commented on Dec 5, 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.

  4. aspiers commented on Dec 10, 2025

    @aspiers

    No reason to believe this is not still occurring.

  5. github-actions commented on Jan 13, 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.

  6. marcindulak commented on Jan 13, 2026

    @marcindulak

    This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at #16497. Upvote or comment on that issue, so maybe it gets noticed.

  7. github-actions commented on Jan 20, 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.

  8. locked as resolved and limited conversation to collaborators on Jan 20, 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