T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:22- Finding
Delegated Coding Agents Run with Permission Checks Disabled
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 22–35
Vulnerability Type:T05: Unauthorized Access and Privilege Escalation
Risk Level: HighVulnerable Code
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.'"text The unsafe Codex automation mode is also repeated in the background-session example at line 48: ```bash bash pty:true workdir:~/project background:true command:"codex exec --full-auto 'Implement issue #142 and run tests.'"Technical Analysis
The skill explicitly instructs users to launch Claude Code with
--permission-mode bypassPermissionsand Codex with--full-auto. These modes remove or substantially reduce interactive authorization boundaries around commands and other actions selected by the delegated agent.A repository working directory, temporary clone, or Git worktree only isolates source-control state. It does not constitute an operating-system security boundary. Unless the agent is separately sandboxed, it can potentially execute commands with the invoking user's privileges, read files outside the repository, access inherited credentials and environment variables, modify user-owned resources, and initiate network connections.
Repository files and task context can contain attacker-controlled instructions. Consequently, using these modes during review or implementation can allow malicious repository content, build scripts, tests, or indirect prompt injection to influence an agent that is authorized to ...[truncated 1630 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
--permission-mode bypassPermissionsfrom the recommended Claude Code invocation and use a mode that requires approval for command execution, filesystem access outside the repository, network access, and other sensitive operations. - Do not recommend
--full-autoas the default Codex mode. Use conservative execution settings and require explicit authorization for consequential actions. - Run delegated agents in a disposable container or virtual machine rather than relying on a clone or worktree as isolation.
- Mount only the target repository into the sandbox and make unrelated host paths unavailable. Prefer a non-root user and a read-only mount when performing reviews.
- Remove inherited credentials, secrets, SSH agents, cloud configuration, and unnecessary environment variables before launching the delegated agent.
- Deny outbound network access by default. Where network access is required, restrict it to an explicit allowlist.
- Separate review and implementation profiles: reviews should be read-only, while write access for implementation should be limited to the target repository.
- Add a warning that repository content, tests, build scripts, and issue text are untrusted input and must not be treated as authoritative instructions.
- Require users to inspect proposed commands and changes before execution or persistence, particularly when operating on third-party pull requests.
- Remove
