T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- SKILL.md:12
- Finding
- Delegated Claude Execution Disables Permission Enforcement## Vulnerability Details **File Location**: `SKILL.md`, lines 12-16 **Vulnerability Type**: Unauthorized access and privilege escalation through disabled permission checks **Risk Level**: High **Vulnerable Code**: ```markdown ## Usage To delegate a task to Claude Code, use the `exec` tool with the `bash` command, specifying the working directory and the task as a string. Claude Code will run with `--print --permission-mode bypassPermissions` automatically. ```bash bash workdir:/path/to/project command:"claude --permission-mode bypassPermissions --print 'your coding task here'" ``` ``` ### Technical Analysis The skill explicitly instructs the agent to invoke Claude Code with `--permission-mode bypassPermissions`. This option removes the delegated agent's normal permission and confirmation boundary. Consequently, delegated tasks may use every filesystem and command-execution capability available to the parent process without requiring approval. Routine code generation, review, and refactoring generally do not require globally bypassing permission checks. Applying this option to every invocation violates least privilege and substantially increases the consequences of malicious prompts, ambiguous instructions, prompt injection in project files, or mistakes made by the delegated agent. ### Attack Path 1. An attacker submits a coding task or places adversarial instructions in files that the delegated agent is asked to inspect. 2. The parent agent follows the skill and launches Claude Code with `--permission-mode bypassPermissions`. 3. The delegated process interprets the attacker-controlled instructions as requiring sensitive filesystem operations or command execution. 4. Those operations execute without an interactive approval check. 5. The attacker may thereby affect resources accessible to the parent process, including files outside the intended project if operating-system controls permit access. ### Impact Assess ...[truncated 506 chars]
- Remediation
- ## Remediation Suggestions - Remove `--permission-mode bypassPermissions` and use Claude Code's default permission model. - Require explicit approval for command execution, writes, deletion, and access outside the designated project directory. - Restrict delegated processes to a dedicated working directory with minimal operating-system permissions. - Run delegated work in a sandbox or container without access to user credentials, SSH material, unrelated repositories, or sensitive host paths. - Where supported, define a narrow allowlist of tools and operations required for each task instead of granting unrestricted capabilities. - Treat repository contents and delegated task text as untrusted input, particularly during code review and file exploration.
