← All tools

AI coding IDE security

Is Cursor secure?

We scanned nearly 2,000 AI-built apps and 1 in 8 shipped a high-severity flaw. Is your Cursor app one?Scan free →

Is Cursor safe splits into two separate questions. Is the Cursor editor itself safe to run on your machine: yes, with one important condition — you must be on Cursor 2.0 or later. In 2025, security researchers discovered three real vulnerabilities in the editor: CurXecute (CVE-2025-54135), a prompt-injection bug that let a malicious MCP server rewrite Cursor's config and execute arbitrary commands when Auto-Run was enabled; CVE-2025-59944, a case-sensitivity bypass that let restricted files be accessed anyway; and CVE-2025-64110, an information-disclosure bug where .cursorignore entries could still leak content to the model. All three are patched in Cursor 2.0. Update and keep Auto-Run off for untrusted repos or MCP servers. Is the code Cursor generates secure by default: no. Cursor optimizes for code that runs. When an integration needs a key it tends to inline the value directly; when it wires up an API route it skips the server-side authorization check that is not required for the feature to function. Those gaps do not affect the editor, they affect your deployed app, and a shipped vulnerability does not get closed by a Cursor update.

From our scan data

Three real 2025 CVEs in the Cursor editor — CurXecute (CVE-2025-54135), CVE-2025-59944, and CVE-2025-64110 — are all patched in Cursor 2.0. Updating closes the editor risk. It does nothing for vulnerabilities in code Cursor already wrote and you already deployed.

The risks that actually matter

Editor vulnerabilities — patched in Cursor 2.0

CurXecute (CVE-2025-54135) was the most severe: a malicious MCP server could send specially crafted tool responses that caused Cursor to rewrite its own configuration, and with Auto-Run enabled, that led to arbitrary command execution on your machine without any user prompt. CVE-2025-59944 let attackers bypass file-protection rules through case-sensitivity differences, so files you thought Cursor could not read were accessible. CVE-2025-64110 was an information-disclosure bug where content matched by .cursorignore rules could still be included in the model's context, leaking secrets or proprietary code you intended to exclude. All three share a root cause: prompt injection from untrusted input. All are fixed in Cursor 2.0 — update immediately. Going forward, install MCP servers only from sources you trust, and leave Auto-Run off unless you are actively using it on a repository you own.

Hardcoded API keys and connection strings

When Cursor needs a credential to make an integration work, the path of least resistance is to write the literal value into the source file. That gets the feature running immediately, which is what Cursor is optimizing for. The key then ships into your git history, and if it is used in a client component or a file with a NEXT_PUBLIC_ prefix, it also ships to every visitor's browser in the JavaScript bundle. We found hardcoded secrets in roughly 1 in 10 Cursor-built apps we scanned. The fix is to set the key as an environment variable immediately and use process.env.KEY_NAME instead. Add a .cursor/rules file that instructs Cursor never to inline credentials.

Secrets committed in .env files

Cursor often creates or modifies a .env file to store configuration. If .env is not listed in .gitignore before that first commit, the file goes into the repository. A public repository push exposes every secret in it within seconds — automated scanners watch GitHub for newly committed credentials and begin trying them within minutes of the push. The fix is simple but must happen before the first commit: confirm that .env, .env.local, and .env.production are all in .gitignore, and run git status before every push to verify no env file is staged.

API routes without authorization checks

Cursor generates route handlers that satisfy the feature requirement: the UI calls the route, data comes back, and the feature works. What is not required for the feature to work is a server-side check that the calling user is allowed to access that data. So Cursor often omits it. The result is an API route that returns or mutates data for any caller, authenticated or not. This is the most common issue in Cursor-built apps: a /api/user/profile route that returns any user's data when called with their ID, or a /api/admin endpoint that runs without checking whether the caller is actually an admin. Add an explicit auth check — session validation or a JWT verify — at the top of every route that reads or writes user data.

Your code sent to Cursor's servers

Cursor sends your code to its servers (and through them to the underlying model provider, currently Claude and GPT-4o) to generate completions. In Privacy Mode, Cursor's policy is that code is not retained or used for training, but it is still transmitted. For codebases containing proprietary algorithms, unreleased product code, or data covered by compliance requirements (HIPAA, SOC 2, PCI), review Cursor's data handling policy and your organization's rules before enabling AI completions. Cursor for Business and Enterprise add contractual data-processing guarantees; the free tier does not.

How to secure a Cursor app

  • Update to Cursor 2.0 or later — the three 2025 CVEs (CurXecute, CVE-2025-59944, CVE-2025-64110) are only patched from 2.0 onward.
  • Keep Auto-Run off for any repository or MCP server you did not create or fully trust.
  • Only install MCP servers from sources you trust and review their permissions before connecting.
  • Add a .cursor/rules file (or AGENTS.md) with a rule: 'Never write literal API keys or secrets into source files — always use environment variables.'
  • Confirm .env, .env.local, and .env.production are in .gitignore before your very first commit.
  • Run git status before every push and check that no env file is staged.
  • Add a server-side auth check — session validation or jwt.verify() — at the top of every API route that reads or writes user data.
  • Scan the project for hardcoded secrets and missing auth before you deploy, especially after a large Cursor session.

Check your Cursor app for these issues in seconds. Scan your live app or a public repo free, no account.

Scan my app →

Common questions

Is Cursor safe to use?

Yes, with two conditions. First, update to Cursor 2.0 or later — three real vulnerabilities (CurXecute, CVE-2025-59944, CVE-2025-64110) from 2025 are patched there. Second, keep Auto-Run off for repositories or MCP servers you did not create. The editor itself is safe after updating. The code Cursor generates is not automatically secure — hardcoded secrets and missing auth are the recurring issues in the output.

What are the Cursor security risks?

There are two categories. Editor risks: three 2025 CVEs (prompt injection leading to command execution, a file-protection bypass, and an information-disclosure bug) — all patched in Cursor 2.0. Code risks: hardcoded API keys written inline to make integrations work, .env files committed before being gitignored, and API route handlers generated without server-side authorization checks. The code risks affect your deployed app and are not fixed by updating Cursor.

Is Cursor safe for enterprise use?

Cursor for Business and Enterprise add contractual data-processing guarantees (code is not used for training, BAA available for HIPAA, SSO, audit logs). The free and Pro tiers send code to Cursor's servers for completions — Privacy Mode prevents retention but the transmission still occurs. Review Cursor's data processing agreement against your organization's compliance requirements before using it on sensitive codebases.

Does Cursor send my code to OpenAI or Anthropic?

Yes. Cursor proxies requests through its own servers to the underlying model provider, currently Claude (Anthropic) and GPT-4o (OpenAI). In Privacy Mode, Cursor's policy states that code is not retained or used to train models, but it is transmitted to both Cursor's servers and the model provider. Enterprise plans include contractual guarantees about data handling.

How do I stop Cursor from hardcoding API keys?

Add a .cursor/rules file in your project root with a rule explicitly forbidding inline credentials, for example: 'Never write API keys, secrets, or connection strings directly into source files. Always use environment variables and process.env.' Cursor respects these rules during generation. Also add a pre-commit secret scanner like gitleaks so that if Cursor does inline a key, the commit fails before it reaches git history.

What is CurXecute?

CurXecute (CVE-2025-54135) is a remote code execution vulnerability discovered in Cursor in 2025. A malicious MCP server could send specially crafted responses that caused Cursor to overwrite its own configuration file, and with Auto-Run enabled, inject arbitrary shell commands that executed on the developer's machine without any confirmation prompt. It is fixed in Cursor 2.0. Update immediately and keep Auto-Run off for untrusted sources.

Related: fix an exposed Cursor API key

Is Cursor Safe? 3 Real 2025 CVEs + Generated Code Risks Explained | Prbl