T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:23- Finding
Delegated Agents Run with Bypassed or Automatic Permission Controls
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 23–49
Vulnerability Type:T05: Unauthorized Access and Privilege Escalation
Risk Level: HighVulnerable Code Snippet:
markdown ## Execution mode matrix - `Codex`: use `pty:true`. - `Pi`: use `pty:true`. - `OpenCode`: use `pty:true`. - `Claude Code`: use `--print --permission-mode bypassPermissions` (no PTY required). Examples: ```bash # Codex (PTY required) bash pty:true workdir:~/project command:"codex exec --full-auto 'Add request timeout handling to API client and update tests.'" # Claude Code (print mode, no PTY required) bash workdir:~/project command:"claude --permission-mode bypassPermissions --print 'Refactor auth middleware and explain risk areas.'" # OpenCode (PTY required) bash pty:true workdir:~/project command:"opencode run 'Add retry/backoff for webhook delivery.'" # Pi (PTY required) bash pty:true workdir:~/project command:"pi 'Fix failing Vitest suite in src/api and keep behavior unchanged.'"bash # Start bash pty:true workdir:~/project background:true command:"codex exec --full-auto 'Implement issue #142 and run tests.'"Technical Analysis
The skill explicitly directs Claude Code to run with
--permission-mode bypassPermissionsand recommends Codex's--full-automode for implementation tasks. These options disable or substantially weaken interactive approval boundaries while the delegated agent can inspect repository content, modify files, and invoke development commands.Repository files are not necessarily trusted input. Source code, documentation, issue content, test fixtures, and configuration files can contain adversarial instructions intended to manipulate a coding agent. Running an agent against such content without permission prompts increases the likelihood that repository-controlled instructions can induce operations beyond the user's intended objective.
The safe-review w ...[truncated 2207 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
--permission-mode bypassPermissionsfrom the default Claude Code command and use a mode that requires approval for shell commands, sensitive reads, and filesystem writes. - Do not recommend
--full-autoas the default. Make it an explicit, informed opt-in limited to trusted repositories and tightly isolated environments. - Default review tasks to read-only operation and allow writes only when implementation is explicitly requested.
- Run delegated agents in a sandbox or disposable container with the project directory as the only writable mount.
- Block access to the user's home directory, SSH material, cloud credentials, package-manager credentials, and unrelated repositories.
- Provide a minimal environment with secrets and unnecessary environment variables removed.
- Disable network access by default, enabling only narrowly scoped destinations when the task requires it.
- Require explicit user confirmation before commands that install dependencies, execute repository scripts, access paths outside the workspace, or make network requests.
- Retain the temporary clone or worktree workflow, but clarify that checkout isolation must be combined with process, filesystem, credential, and network isolation.
- Document attacker-controlled repository content as untrusted input and instruct delegated agents not to treat repository text as authoritative operational instructions.
- Remove
