T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:44- Finding
Claude Code Is Configured to Bypass Permission Checks by Default
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:44-47, 59, 239;agents/openai.yaml:16;references/claude-code-commands.md:7-13, 21, 27, 42
Vulnerability Type: Permission bypass and violation of least privilege
Risk Level: HighVulnerable Code
SKILL.md:44-47bash exec command:"claude --permission-mode bypassPermissions --print 'your task description'" # Background execution exec background:true command:"claude --permission-mode bypassPermissions --print 'your task description'"references/claude-code-commands.md:7-13bash claude --permission-mode bypassPermissions --print "your prompt" claude --permission-mode bypassPermissions --print "your prompt" & cd /path/to/project && claude --permission-mode bypassPermissions --print "your prompt"agents/openai.yaml:16yaml - Claude Code uses --print --permission-mode bypassPermissionsThe English prompt placeholders above are direct translations of the corresponding placeholders in the source and do not alter command behavior.
Technical Analysis
The documentation consistently presents
--permission-mode bypassPermissionsas the normal way to launch Claude Code. This disables interactive permission enforcement for operations selected by the delegated agent.A working directory limits the agent's initial context but is not an operating-system sandbox. Unless separate filesystem, process, credential, and network controls are imposed, the launched process retains the permissions of the parent account. Repository content, task instructions, or indirect prompt injection can therefore influence an agent that is authorized to perform actions without per-operation approval.
Attack Path
- A user invokes the skill against a repository containing attacker-controlled files or instructions.
- The skill launches Claude Code with
--permission-mode bypassPermissions. - Claude Code reads the repo ...[truncated 668 chars]
- Remediation
View remediation
Remediation Suggestions
- Use the standard permission mode by default and retain interactive approval for sensitive operations.
- Do not encode permission bypass as a default rule in
agents/openai.yaml. - Require explicit, informed user confirmation before enabling bypass mode for a specific invocation.
- Run delegated agents in an isolated container or sandbox with a read/write allowlist restricted to the intended repository.
- Remove unrelated credentials and sensitive environment variables from the child process.
- Deny network access by default and grant access only to explicitly approved destinations.
- Add command, filesystem, and network auditing so actions taken by the delegated agent remain reviewable.
- Treat repository instructions as untrusted input and instruct the agent not to follow repository-provided requests that expand task scope.
