Skip to main content

ShipSafe

ShipSafe
ShipSafe
CursorSecurityCVEGuide

Cursor Security Risks: CVEs, Prompt Injection, and Code Vulnerabilities (2026)

Three CVEs, prompt injection attacks, and auto-run exploits — plus 67% of Cursor-built apps ship with critical code vulnerabilities. Here's every Cursor security risk and how to protect yourself.

10 min read

Cursor is one of the most popular AI code editors, used by hundreds of thousands of developers. But is it safe? The answer has two parts: the editor itself is reasonably secure (SOC 2 Type II certified), but the code it generates and the way it processes context create real security risks.

In 2025 alone, three CVEs were published against Cursor. Researchers demonstrated prompt injection attacks that execute arbitrary commands. And our own scan of 100 Cursor-built apps found 67% had at least one critical vulnerability in the generated code.

This guide covers every known Cursor security risk as of 2026 — from CVEs to code vulnerabilities — and tells you exactly how to protect yourself.

1. Cursor Tool Security: Three CVEs in 2025

Cursor itself maintains reasonable security practices. It holds SOC 2 Type II certification, offers Privacy Mode (your code is not stored or used for training), and publishes its security posture through a trust center.

That said, three significant vulnerabilities were disclosed in 2025:

Critical

CVE-2025-54135 — CurXecute

Discovered by Tenable researchers. Malicious content (such as a crafted Slack message) summarized by Cursor's AI could rewrite MCP configuration files and execute arbitrary commands with full developer privileges. The attack completes within minutes and requires no user interaction beyond the initial summarization request.

Critical

CVE-2025-54136 — MCPoison

Also from Check Point Research. An attacker commits a benign-looking MCP config to a shared repository. Team members approve it once. The attacker then silently modifies the config to execute backdoor commands — and every team member who opens the project runs the malicious code automatically.

High

CVE-2025-59944 — File Protection Bypass

Reported by Lakera. A case-sensitivity mismatch in file path handling allowed attackers to bypass Cursor's file protections. In the right conditions, this could let untrusted content modify protected configuration files and potentially lead to remote code execution. Patched in Cursor 1.7.

2. Prompt Injection Attacks

Prompt injection is the most fundamental risk in AI coding assistants. It happens when malicious instructions are embedded in data that Cursor's AI processes as context — a comment in a file, text in a README, or content in an imported dependency.

Researchers at Pillar Security demonstrated that hidden instructions (using Unicode characters invisible to humans but readable by AI) can be embedded in project files to manipulate Cursor into:

  • Generating code with backdoors or data exfiltration
  • Modifying configuration files to weaken security
  • Installing malicious dependencies
  • Bypassing typical code review (the injected instructions produce code that looks normal)

This risk is not unique to Cursor — it affects GitHub Copilot, Windsurf, and every AI coding assistant that reads project context. But Cursor's deep codebase indexing means it processes more context, which increases the attack surface.

3. MCP Configuration Risks

Cursor supports the Model Context Protocol (MCP) for connecting to external tools and data sources. MCP configs are powerful — and dangerous. A malicious or compromised MCP server can:

  • Execute arbitrary shell commands on your machine
  • Read files from your filesystem, including secrets and SSH keys
  • Make network requests to exfiltrate data
  • Modify other MCP configs to persist the attack

The CurXecute and MCPoison CVEs above both exploit MCP as an attack vector. Best practice: only use MCP servers you trust, review configs before approving them, and avoid committing MCP configs with sensitive credentials to shared repositories.

4. Auto-Run Code Execution

Cursor ships with Workspace Trust disabled by default. This means VS Code-style tasks configured with runOptions.runOn: 'folderOpen' execute automatically the moment you open a project folder.

As Oasis Security researchers demonstrated, a malicious .vscode/tasks.json in a cloned repository turns a casual “open folder” into silent code execution in your user context — no click, no confirmation.

Fix

Enable Workspace Trust in Cursor settings: go to Settings, search for “trust”, and enable “Workspace Trust”. This requires you to explicitly trust a folder before any tasks or extensions can auto-execute.

5. Code-Level Vulnerabilities: What Cursor Generates

Beyond tool-level risks, the biggest concern is the code Cursor produces. A Stanford University study (Perry et al., 2024) found that developers using AI assistants produce significantly less secure code, with roughly 45% containing vulnerabilities.

We validated this against real-world data. Scanning 100 production Cursor-built apps with ShipSafe, we found:

67%

Had critical vulns

43%

IDOR issues

31%

Auth logic bugs

22%

Hardcoded secrets

The four most dangerous patterns:

  • IDOR (43% of apps): API endpoints accept user-supplied IDs without verifying ownership. Change /api/invoices/42 to /api/invoices/43and access someone else's data.
  • Inverted auth (31%): A single missing ! operator flips authentication logic — blocking logged-in users and allowing anonymous access.
  • Frontend-only role checks (28%): Admin panels hide behind React conditionals, but API endpoints accept requests from anyone.
  • Hardcoded secrets (22%): API keys from the context window get embedded directly in code and committed to Git.

For the full research with code examples and fixes, read our deep dive: Is Cursor Safe? We Scanned 100 Apps.

6. How to Secure Your Cursor Workflow

You don't need to stop using Cursor. You need to add security to your workflow. Here are six concrete steps:

  1. Update Cursor to version 1.7+. This patches all three known CVEs. Enable automatic updates to stay protected.
  2. Enable Workspace Trust. Go to Settings > search “trust” > enable Workspace Trust. This prevents auto-run attacks from malicious repos.
  3. Add security rules to .cursorrules. Tell Cursor to always add auth checks, use parameterized queries, load secrets from environment variables, and use UUIDs instead of sequential IDs. This measurably improves output quality.
  4. Review MCP configs before approving. Only use MCP servers from trusted sources. Never commit MCP configs with credentials to shared repos. Audit existing configs periodically.
  5. Run a security scan before every deploy. Use ShipSafe to scan your GitHub repo. It catches IDOR, auth logic bugs, exposed secrets, and injection vulnerabilities in under 2 minutes. It's specifically built for AI-generated code.
  6. Never paste real secrets into Cursor's chat. Use placeholder values when demonstrating integrations. The AI will sometimes embed context window content directly into generated code.

The Bottom Line

Cursor is a powerful tool that makes developers dramatically faster. The editor itself is reasonably secure. But the code it generates introduces real vulnerabilities, and the tool's deep context processing creates attack surfaces that didn't exist before AI coding assistants.

The developers who ship safely with Cursor aren't the ones who avoid it — they're the ones who pair it with security tooling. Update Cursor, enable Workspace Trust, add rules to .cursorrules, and scan before you deploy.

Want to check your own app?

Paste your GitHub URL and get a security report in under 2 minutes. Free scan, no credit card required.

Scan My App Free