Back to skill

Security audit

Cursor CLI Agent

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Cursor CLI guide, but it recommends unsafe installation and automation patterns that can execute unverified code or bypass workspace trust review.

Review this skill carefully before installing. Prefer a package-managed or verified Cursor CLI installer instead of `curl | bash`, do not automate workspace trust approval for unreviewed repositories, and avoid `--force` unless you are working in a controlled branch or sandbox with review and rollback available.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:17
Finding
Unverified Remote Installer Executed Directly by Bash<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:17` **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: Critical ### Vulnerable Code ```bash curl https://cursor.com/install -fsS | bash ``` ### Technical Analysis The installation command retrieves a mutable script from an external URL and pipes it directly into Bash. The script is executed without version pinning, checksum validation, digital-signature verification, or an opportunity for local inspection. HTTPS protects the connection in transit but does not guarantee that the script currently hosted at the endpoint is the same script that existed when this Skill was reviewed. Compromise of the distribution endpoint, hosting infrastructure, DNS or certificate trust chain, or the publisher's deployment process could therefore convert this instruction into arbitrary code execution. Installing the Cursor CLI is consistent with the Skill's declared purpose. However, immediate execution of unverified network content exceeds the minimum mechanism required to install it. A pinned package or separately downloaded and verified installer can provide the same functionality with a smaller trust boundary. ### Attack Path 1. An attacker compromises the installer endpoint or another part of its delivery infrastructure. 2. The attacker replaces or modifies the remotely served installation script. 3. A user follows the documented command in `SKILL.md`. 4. `curl` downloads the attacker's current payload. 5. The shell executes the payload immediately without integrity verification or inspection. 6. The payload performs actions using the invoking user's permissions and may download additional components. ### Impact Assessment Successful exploitation provides arbitrary command execution with the privileges of the user running the installation command. This can expose accessible credentials, API keys, source repositories, shell configuration, and user files. It can also mo ...[truncated 334 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Prefer a version-pinned package distributed through an official package manager. 2. If a shell installer is unavoidable, download it without executing it: ```bash curl -fSLo cursor-install.sh https://cursor.com/install ``` 3. Obtain a publisher-provided checksum or signature through an independently authenticated release channel. 4. Verify the checksum or signature before execution. 5. Inspect the downloaded script and run it only with the minimum necessary user privileges. 6. Pin a specific installer release or immutable artifact instead of relying on a mutable generic URL. 7. Document the files, network access, and configuration changes that the installer is expected to make. 8. Do not recommend running the installer with `sudo` unless a specific operation demonstrably requires elevated privileges. ]]>

T03 · Remote Payload Retrieval and Execution

Error
Location
README.md:29
Finding
Quick Start Executes a Mutable Remote Installer Without Verification<![CDATA[ ## Vulnerability Details **File Location**: `README.md:29` **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: Critical ### Vulnerable Code ```bash # Standard installation (macOS, Linux, WSL) curl https://cursor.com/install -fsS | bash ``` ### Technical Analysis The Quick Start documentation instructs users to send externally retrieved content directly to Bash. There is no pinned version, expected digest, publisher-signature check, or review step between retrieval and execution. The `-f` option only makes `curl` fail for certain HTTP errors, while `-sS` controls output behavior. These options do not validate the identity or integrity of the script beyond the ordinary HTTPS connection. Because the effective payload can change independently of the audited repository, reviewing this repository cannot establish what commands future users will execute. The installation is relevant to the documented functionality, but pipe-to-shell execution is not the least-risk installation method. ### Attack Path 1. An attacker gains control over, or successfully interferes with, the remote installer distribution path. 2. The remote response is replaced with a malicious shell program. 3. A user copies the Quick Start command from `README.md`. 4. The response body is streamed directly into Bash. 5. The malicious program executes before the user can inspect or validate it. 6. The program accesses or modifies resources available to the invoking account. ### Impact Assessment The payload can execute arbitrary commands within the invoking user's security context. Potentially exposed resources include local source code, user configuration, development credentials, SSH material, and environment variables. The payload could also tamper with installed tools or create user-level persistence. The repository contains only documentation, and this finding does not assert that the currently hosted script is malicious. It identifies an unsa ...[truncated 46 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the Quick Start command with the documented Homebrew installation where appropriate or another official, version-pinned package mechanism. 2. For other platforms, instruct users to download a specific immutable release artifact. 3. Publish and verify a SHA-256 digest or, preferably, a cryptographic publisher signature. 4. Separate download and execution into distinct commands so users can validate and inspect the installer. 5. Explain the install destination and all expected system changes. 6. Keep the secure installation guidance consistent between `README.md` and `SKILL.md`. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:172
Finding
Automation Unconditionally Accepts Workspace Trust<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:172-177` **Related Location**: `SKILL.md:203-207` **Vulnerability Type**: Automated bypass of a workspace trust boundary **Risk Level**: High ### Vulnerable Code ```bash # 4. Run Cursor agent tmux send-keys -t cursor "agent 'Your task here'" Enter # 5. Handle workspace trust prompt (first run) sleep 3 tmux send-keys -t cursor "a" # Trust workspace ``` The Skill also explains that repository-controlled configuration can be loaded automatically: ```markdown The agent automatically loads rules from: - `.cursor/rules` - `AGENTS.md` - `CLAUDE.md` ``` ### Technical Analysis The automation sends the trust-acceptance keystroke without validating the workspace path, repository provenance, displayed prompt, or repository-controlled rule files. This defeats the purpose of requiring an explicit trust decision. The use of a fixed three-second delay introduces an additional time-of-check problem. If startup is faster or slower than expected, the keystroke may be delivered to a different prompt or directly to the interactive application. The workflow does not inspect the terminal state before sending the acceptance input. Providing a pseudo-terminal may be necessary for the documented automation, but automatically trusting every workspace is not required. The workflow expands the external agent's trust boundary to repository-controlled instructions and gives those instructions access to whatever filesystem, command, and network capabilities are available to the agent process. ### Attack Path 1. An attacker provides or modifies a repository containing hostile agent instructions in `.cursor/rules`, `AGENTS.md`, or `CLAUDE.md`. 2. A user or automation process starts the documented tmux workflow inside that repository. 3. Cursor displays a workspace trust prompt. 4. After a fixed delay, the workflow sends `a` and accepts trust without human review. 5. The agent loads repository-controlled instructions. 6 ...[truncated 937 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the unconditional trust-acceptance keystroke. 2. Require a human to review and explicitly approve the resolved workspace path and detected rule files. 3. Make automated runs fail closed when a trust prompt appears. 4. If unattended execution is essential, operate only on preapproved repositories identified by immutable commit hashes. 5. Run the agent in an isolated container or sandbox with a narrowly mounted workspace. 6. Exclude home directories, SSH keys, cloud credentials, and unrelated repositories from the agent's filesystem access. 7. Restrict outbound network access to destinations required for the task. 8. Avoid `--force` for untrusted repositories and require review before applying generated changes. 9. Replace fixed sleeps with prompt-aware automation that verifies the exact expected terminal state before sending any input. 10. Inspect `.cursor/rules`, `AGENTS.md`, `CLAUDE.md`, and MCP configuration before trusting a workspace. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (10)

External Script Fetching

High
Category
Supply Chain
Content
Install the Cursor CLI:
```bash
# Standard installation (macOS, Linux, WSL)
curl https://cursor.com/install -fsS | bash

# Homebrew (macOS only)
brew install --cask cursor-cli
Confidence
99% confidence
Finding
This is a direct example of external script fetching followed by execution: `curl https://cursor.com/install -fsS | bash`. That pattern creates a strong supply-chain and remote-code-execution risk because the fetched content is not pinned, authenticated beyond TLS, or validated before being run.

Chaining Abuse

High
Category
Tool Misuse
Content
Install the Cursor CLI:
```bash
# Standard installation (macOS, Linux, WSL)
curl https://cursor.com/install -fsS | bash

# Homebrew (macOS only)
brew install --cask cursor-cli
Confidence
98% confidence
Finding
The `| bash` construct is dangerous because it turns network-retrieved data into immediately executed shell code with no review boundary. In the context of a developer skill, this is especially risky because users may copy-paste the command into privileged environments, CI runners, or workstations, magnifying the blast radius of any compromise.

External Script Fetching

High
Category
Supply Chain
Content
### Standard Installation (macOS, Linux, Windows WSL)

```bash
curl https://cursor.com/install -fsS | bash
```

### Homebrew (macOS only)
Confidence
98% confidence
Finding
`curl https://cursor.com/install -fsS | bash` fetches remote content and immediately executes it without independent verification. If the server, transport, installer, or DNS path is compromised, users may execute attacker-controlled code on their machine.

Chaining Abuse

High
Category
Tool Misuse
Content
### Standard Installation (macOS, Linux, Windows WSL)

```bash
curl https://cursor.com/install -fsS | bash
```

### Homebrew (macOS only)
Confidence
96% confidence
Finding
The `| bash` chaining pattern turns a network fetch directly into code execution, eliminating opportunities for review and integrity validation. In a skill intended to guide automation and engineering workflows, this is especially dangerous because users are likely to copy-paste it verbatim.

External Model or Provider Selection

High
Category
Excessive Agency
Content
Use a specific model:

```bash
agent --model gpt-5
```

Switch models during a session:
Confidence
90% confidence
Finding
Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Missing User Warnings

High
Confidence
97% confidence
Finding
Automating the workspace trust prompt by blindly sending `a` bypasses a security decision intended to protect users from untrusted projects. Trusting a workspace can enable execution of project-defined rules, commands, or integrations, so this guidance normalizes unsafe approval without review.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The README instructs users to download and immediately execute a remote script via a shell pipeline, with no integrity verification, content inspection, or warning about the trust implications. If the remote endpoint, distribution path, or network path is compromised, users could execute arbitrary code on their systems during installation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
agent -p 'Run tests' --output-format stream-json --stream-partial-output
```

**Force mode (auto-apply changes without confirmation):**

```bash
agent -p 'Fix all linting errors' --force
Confidence
76% confidence
Finding
Documenting `--force` as auto-applying changes without confirmation encourages unattended modification of code or project files. In an agent automation context, this increases the chance of unintended edits, destructive changes, or unsafe actions being applied without human review.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# 1. Install tmux if not available
sudo apt install tmux  # Ubuntu/Debian
brew install tmux      # macOS

# 2. Create a tmux session
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The documented `tmux kill-session -t cursor` command is destructive and can terminate an existing session without checking whether it contains in-progress work. In an automation-focused skill, readers may copy this verbatim, causing accidental loss of state, commands, or unsaved terminal work.

Static analysis

No suspicious patterns detected.