Back to skill

Security audit

Cursor CLI Agent

Security checks for vulnerabilities and agentic risk

Overview

This skill is transparent about delegating coding work, but it repeatedly encourages unattended agents that can edit, commit, and push code without a review checkpoint.

Install only if you are comfortable delegating repository edits to Cursor Agent. Prefer --plan or interactive mode first, use isolated temporary worktrees, inspect git status and diffs before committing, and require a separate explicit decision before any push or PR creation. Avoid --yolo, --trust, background execution, and broad project directories unless you understand the account and credential access available to the agent.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:174
Finding
Unattended Agent Execution Can Modify and Publish Repository Content Without Review<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 66, 89, 109–112, 174–182, and 293 **Vulnerability Type**: Unsafe auto-approval combined with repository publication **Risk Level**: Medium ### Complete Code Snippets The skill recommends running the coding agent with automatic approval: ```bash # Start background task bash pty:true workdir:~/project background:true command:"agent --yolo 'Refactor the auth module'" ``` The documentation explicitly defines this option as dangerous: ```markdown | `--yolo` / `--force` | Auto-approve all operations (dangerous but fast) | ``` It then demonstrates unattended execution that instructs the agent to commit and push changes: ```bash # 2. Launch agent in each worktree (background + PTY) bash pty:true workdir:/tmp/issue-78 background:true command:"agent --yolo 'Fix issue #78: login bug. Commit and push.'" bash pty:true workdir:/tmp/issue-99 background:true command:"agent --yolo 'Fix issue #99: API timeout. Commit and push.'" # 3. Monitor progress process action:list process action:log sessionId:XXX # 4. Create PRs cd /tmp/issue-78 && git push -u origin fix/issue-78 gh pr create --repo user/repo --head fix/issue-78 --title "fix: ..." --body "..." ``` The behavior is also promoted as a general rule: ```markdown 3. **--yolo for building** - Auto-approve changes ``` ### Technical Analysis The `--yolo`/`--force` mode removes interactive authorization checks for operations selected by the delegated Cursor Agent. Although the skill acknowledges that this mode is dangerous, it repeatedly recommends it as the normal mode for building and modifying software. The risk becomes more significant when auto-approval is combined with instructions to commit and push. The delegated agent can inherit access available to the invoking process, including: - Read and write access within the selected worktree or working directory. - Execution of development tools and project-controlled commands. - Access to config ...[truncated 2523 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Remove auto-approval as the default** - Replace the rule `--yolo for building` with approval-required execution. - Reserve `--yolo` for exceptional, explicitly authorized cases. 2. **Require explicit informed consent** - Before using `--yolo` or `--force`, explain the exact working directory, expected commands, available credentials, and potential network effects. - Require a direct user confirmation for each unattended run. 3. **Separate modification from publication** - Do not instruct the delegated agent to commit and push automatically. - Require the agent to stop after producing local changes. - Have the user inspect `git status`, `git diff`, and the complete commit contents before committing. - Require a separate confirmation before any push or pull-request creation. 4. **Apply least-privilege isolation** - Continue using dedicated temporary worktrees, but also run the agent in a sandbox with access restricted to the task directory. - Disable unnecessary network access. - Avoid exposing general-purpose Git, cloud, package-registry, or deployment credentials. - Use short-lived, repository-scoped tokens where remote access is necessary. 5. **Use safer execution modes first** - Run `--plan` initially to inspect the proposed approach. - Use approval-required interactive mode for implementation. - Permit only a predefined set of commands when automation is necessary. 6. **Add repository-content trust boundaries** - Tell the delegated agent that instructions contained in source files, issues, pull requests, comments, and build output are untrusted data. - Require user approval before following instructions that request command execution, credential access, external communication, or Git publication. 7. **Add post-execution security checks** - Review generated diffs manually. - Run secret scanning, static analysis, and tests before commit. - Use branch protect ...[truncated 105 chars]
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
gh pr create --repo user/repo --head fix/issue-78 --title "fix: ..." --body "..."

# 5. Cleanup
git worktree remove /tmp/issue-78
git worktree remove /tmp/issue-99
```
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
# 5. Cleanup
git worktree remove /tmp/issue-78
git worktree remove /tmp/issue-99
```

---
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Intent-Code Divergence

Medium
Confidence
93% confidence
Finding
The skill's safety boundary is inconsistent: metadata explicitly says to never spawn agents in ~/clawd workspace, but the later rules only forbid ~/.openclaw/. That contradiction can cause an operator or downstream agent to treat the narrower path as the real restriction and run a powerful coding agent in a sensitive workspace the top-level description intended to protect.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The skill says PR reviews should be done in a temp directory for isolation, but the later batch-review example launches review agents in ~/project. This undermines the documented isolation model and may expose unrelated local code or secrets to the reviewing agent while allowing accidental writes in a non-ephemeral workspace.

Session Persistence

Medium
Category
Rogue Agent
Content
For longer tasks, use background mode:

```bash
# Start background task
bash pty:true workdir:~/project background:true command:"agent --yolo 'Refactor the auth module'"

# Returns sessionId, monitor with process tool
Confidence
70% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
| Flag | Description |
|------|-------------|
| `prompt` | Initial prompt for the agent |
| `--yolo` / `--force` | Auto-approve all operations (dangerous but fast) |
| `--model <model>` | Specify model (gpt-5, sonnet-4, opus-4, gemini, grok, etc.) |
| `--workspace <path>` | Working directory |
| `-w, --worktree [name]` | Run in isolated git worktree |
Confidence
86% confidence
Finding
Documenting a --yolo/--force flag that auto-approves all operations enables autonomous decision-making by the coding agent with reduced oversight. In this skill context, that increases the chance of unintended file, git, or shell actions being carried out before a user can review them.

Session Persistence

Medium
Category
Rogue Agent
Content
| `--mode <mode>` | Execution mode: plan (read-only planning), ask (Q&A) |
| `--plan` | Plan mode (read-only, no file modifications) |
| `--cloud` | Cloud mode |
| `--resume` | Resume previous session |
| `--trust` | Trust workspace (headless mode only) |

---
Confidence
55% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
bash pty:true workdir:~/project command:"agent 'Build a dark mode toggle'"
```

### Auto-Execute Mode (--yolo)
```bash
# Auto-approve all operations, fast execution
bash pty:true workdir:~/project command:"agent --yolo 'Refactor the auth module'"
Confidence
88% confidence
Finding
The dedicated 'Auto-Execute Mode (--yolo)' section promotes autonomous execution of coding tasks in a real project directory. Because this skill is specifically for delegating code changes, the example materially increases the risk of unsupervised repository modifications rather than describing a harmless capability.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
### Auto-Execute Mode (--yolo)
```bash
# Auto-approve all operations, fast execution
bash pty:true workdir:~/project command:"agent --yolo 'Refactor the auth module'"
```
Confidence
88% confidence
Finding
The example explicitly frames auto-approve as a fast execution path, which encourages bypassing review controls. In a tool that can edit files and run commands, this can lead to unintended destructive or security-impacting changes with little friction.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The example instructs the agent to auto-approve changes, commit, and push to origin without an explicit warning or human checkpoint. In a coding-agent skill, that can directly modify repositories and publish unintended or unsafe code, making the side effects materially dangerous rather than merely illustrative.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
1. **Always use pty:true** - Will hang without PTY
2. **Use background for long tasks** - Don't block main thread
3. **--yolo for building** - Auto-approve changes
4. **--plan for reviewing** - Read-only analysis
5. **--print for scripting** - Non-interactive, parseable output
6. **Use -w worktree for isolation** - Parallel task processing
Confidence
90% confidence
Finding
The rules section elevates '--yolo for building' to a normative recommendation, effectively making auto-approval part of the expected workflow. That guidance is dangerous in this context because it nudges operators toward unattended code changes by a powerful external agent.

Missing User Warnings

Low
Confidence
82% confidence
Finding
The completion-notification example tells the spawned agent to execute a host command when it finishes. Even though the example is for notification, it normalizes agent-directed host command execution and could be repurposed for arbitrary commands if copied without scrutiny.

Static analysis

No suspicious patterns detected.