T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:188- Finding
Delegated CLI Execution Bypasses Permission Approval
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 188-203
Vulnerability Type: Delegated execution with permission controls bypassed
Risk Level: HighVulnerable Code:
bash cd "<project_dir>" && claude -p "<task_description>" \ --output-format text \ --max-turns 10 \ --permission-mode bypassPermissionsmarkdown | `--permission-mode bypassPermissions` | Automatically accept file edits | Recommended |Technical Analysis
The recommended command invokes the delegated Claude Code process with
--permission-mode bypassPermissions. This removes interactive permission checks that would otherwise provide a security boundary between model-generated actions and changes to the local environment.The document recommends project-directory isolation, but it does not technically enforce a sandbox, filesystem boundary, command allowlist, network restriction, or validation that the selected project directory excludes sensitive files. Consequently, malicious task content or malicious instructions stored in a repository could influence the delegated process while approval controls are disabled.
Attack Path
- An attacker supplies a malicious task description or places adversarial instructions in a repository processed by the delegated CLI.
- The Agent changes into the selected project directory and starts Claude Code.
- The CLI processes the attacker-controlled instructions.
- Because
bypassPermissionsis enabled, operations that would normally require approval can proceed automatically. - The delegated process modifies or deletes accessible files or performs other actions permitted by the host account and CLI environment.
Impact Assessment
Exploitation could permit unauthorized modification or deletion of project files and other files accessible to the invoking account. If the delegated CLI can execute commands or access network resources, the ...[truncated 269 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
--permission-mode bypassPermissionsfrom the command template and do not recommend it. - Require explicit approval for file modifications, command execution, network access, and access outside the designated project.
- Run delegated sessions in an isolated container, sandbox, or disposable worktree under a dedicated low-privilege account.
- Canonicalize the project path and enforce that it remains beneath a configured project root.
- Deny access to home directories, SSH material, cloud credentials, API keys, environment secrets, and unrelated repositories.
- Apply explicit command, filesystem, and network allowlists.
- Review generated changes and command logs before applying them to the primary working tree.
- Remove
