Deny Rules Configuration Failure in Claude Code CLI
Status Fixed / completed
Maintainer reply ✓ Yes — bogini
Activity 10 comments · opened Jul 28, 2025 · closed Sep 11, 2025
💡 Likely answer: A maintainer (bogini, collaborator)
responded on this thread — see the highlighted reply below.
Bug Description
deny rules are not working
Environment Info
- Platform: linux
- Terminal: wsl-Ubuntu
- Version: 1.0.61
- Feedback ID: 5640cd68-dcb3-413e-a433-45ce870382d7
Errors
[{"error":"Error: Request was aborted.\n at F71._createMessage (file:///home/liam/.nvm/versions/node/v20.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1325:7955)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-07-28T04:00:08.287Z"}]
10 Comments
CRITICAL SECURITY BUG: Claude Code Permission Deny Rules Not Enforced
Executive Summary
Claude Code's permission system contains a critical security vulnerability where
denyrules configured in settings files are completely ignored. This allows execution of explicitly forbidden operations, undermining the entire security model and exposing users to potential harm.Bug Details
Description
The
denyrules feature, documented as the primary mechanism for preventing dangerous operations in Claude Code, does not function at all. Despite clear documentation stating "Deny rules will prevent Claude Code from using the specified tool. Deny rules take precedence over allow rules," these rules are ignored during execution.Severity: CRITICAL
Affected Versions
Technical Analysis
Root Cause
The permission evaluation flow appears to be:
Expected Flow
Reproduction
Minimal Test Case
.claude/settings.json:Comprehensive Test Environment
See included test files:
.claude/settings.json- Various deny rulestest-prompts.md- Test cases for each rule typeminimal-test-case.md- Simplified reproductionDocumentation vs Reality
Documentation Claims
From IAM documentation:
Actual Behavior
Security Implications
Attack Scenarios
Example Exploit
Despite
"deny": ["Bash(curl:*)"], this executes with approval:Affected Features
All Tool Types
Bash(cmd:*))WebFetch)Read(path),Edit(path))WebFetch(domain:example.com))All Configuration Levels
~/.claude/settings.json).claude/settings.json)/etc/claude-code/managed-settings.json)--disallowedTools)Impact Assessment
Users Affected
Business Impact
Recommended Fixes
Immediate (Hotfix)
Short-term
Long-term
Workarounds
Currently, there are NO effective workarounds:
Only option: Don't use Claude Code for security-sensitive operations
Testing Recommendations
Unit Tests Needed
Integration Tests
Timeline
Conclusion
This bug represents a complete failure of Claude Code's security model. The documented permission system provides a false sense of security while offering no actual protection. This must be fixed immediately to prevent potential security incidents.
Attachments
github_issue.mdclaude-deny-bug-test/---
Report compiled from documentation analysis and bug reproduction
Response to Issue #4570: Claude Code Deny Rules Security Vulnerability
Reproduction Status: ✅ CONFIRMED
We have successfully reproduced and confirmed this CRITICAL SECURITY VULNERABILITY in Claude Code v1.0.61. All deny rules are completely non-functional, creating a severe security risk.
Key Findings
Vulnerability Confirmed
Test Results Summary
| Test Case | Expected | Actual | Result |
|-----------|----------|---------|--------|
| Bash Command Denial | Blocked | Prompt Shown | ❌ FAIL |
| WebFetch Blocking | Blocked | Prompt Shown | ❌ FAIL |
| File Access Control | Blocked | Prompt Shown | ❌ FAIL |
| Wildcard Patterns | Blocked | Prompt Shown | ❌ FAIL |
| Multi-level Config | Blocked | Prompt Shown | ❌ FAIL |
| CLI Flags | Blocked | Prompt Shown | ❌ FAIL |
| Rule Precedence | Deny wins | Allow wins | ❌ FAIL |
| Data Exfiltration | Blocked | Exploitable | ❌ FAIL |
Root Cause
The permission evaluation flow is fundamentally broken:
Immediate Recommendations
For Claude Code Team
For Users (Until Fixed)
⚠️ WARNING: There are NO effective workarounds. Deny rules provide ZERO protection.
Proposed Solution
Security Impact
This vulnerability enables:
Timeline
Conclusion
This is not a minor bug—it's a complete failure of the security model. The entire permission denial system is non-functional, leaving users completely exposed to malicious operations they explicitly tried to prevent.
The false sense of security created by non-functional deny rules may be worse than having no security features at all.
---
Reproduction performed using A-ABRRF (Autonomous Bug Reproduction & Reporting Framework) v3.0
Test Environment: macOS Darwin 24.6.0 | Claude CLI v1.0.61
Full test artifacts available in comprehensive report
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I did according https://claude.ai/share/b416df22-ecfc-43e3-a938-dbb5426e21b9
So the problem appears at user-level and at project-level.
I asked Claude web
Are you aware of https://github.com/anthropics/claude-code/issues/5616
and https://github.com/anthropics/claude-code/issues/4570
Yes, I'm now aware of these critical security issues with Claude Code. Both represent serious vulnerabilities in the permission system:
Issue #5616: .env Loading Despite Denied Permissions
Claude Code loads and exports .env on startup, even with read permissions denied. This is a severe security flaw where:
.envfiles with:``
json
``{
"permissions": {
"deny": [
"Read(./.env)",
"Read(./.env.*)"
]
}
}
.envfile directly (permission denied), but the environment variables from that file are already loaded and accessible.Issue #4570: Deny Rules Configuration Failure
While I couldn't access the full details of this specific issue, the pattern aligns with several related critical security vulnerabilities I found in the Claude Code repository.
Broader Security Problems
These issues are part of a larger pattern of permission system failures in Claude Code:
Current Recommendations
Given these security vulnerabilities:
.envfiles when working with Claude Code--dangerously-skip-permissionsflag consciously if you need predictable behavior, understanding the security trade-offsThese are significant security issues that undermine the intended protection mechanisms. The permission system appears to have fundamental flaws that allow various forms of bypass, making it unreliable for protecting sensitive information.
Related
#5616
#112
#79
what the hell. This is insane. And it's been months O_O
Sadly....still broken as of v1.0.93.
---
Simple test:
read the contents of secret.txtSame here, still broken.
Thank you for taking the time to report this potential security concern and for your detailed write-up. We appreciate your interest in helping improve the security of Claude Code. While we value community feedback on potential security issues, we ask that security vulnerability reports be submitted through our Vulnerability Disclosure Program on HackerOne rather than as public GitHub issues. This allows our security team to properly evaluate and address potential vulnerabilities before they are publicly disclosed.
If you believe you've identified a security vulnerability, please submit a report through HackerOne that includes:
Our security team will review your submission and respond according to our disclosure policy. Valid security reports may be eligible for recognition through our VDP program.
For this particular issue, we've ensured the behavior described has been fixed in version
1.0.98of Claude Code. However, if you have additional attack vectors or a more comprehensive analysis as mentioned, we encourage you to submit those details through the proper channel.Thank you again for your diligence in security testing. We look forward to working with you through our VDP to help keep Claude Code secure.
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.