Cursor app security: protect your secrets, your editor and your app

By the FixMyVibe team · Last reviewed 16 October 2026
Apps built with Cursor fail in the same places as other AI-built apps: secrets committed to the repo and database rules that are too open. On top of that, the agent itself runs commands on your machine, so keep Cursor updated, review MCP servers and terminal commands before approving them, and keep secret files out of the agent's reach.
Two different things to secure
The app you build ends up on the internet, so leaked keys and open database rules are the main risk there. Your development environment is where the Cursor agent reads files, edits code and runs commands; prompt injection (instructions hidden in files, web pages or tool output) targets that side.
The typical risks
1. Secrets committed to the repo
Cursor's agent can write workspace files without approval (except configuration files), and changes save immediately. A key pasted into a prompt can end up hardcoded in a file and then in a commit. Review diffs before committing; see leaked API keys.
2. Secret files within the agent's reach
Cursor ignores .env* and anything in .gitignore by default, and you can add more paths in .cursorignore. Cursor's docs are explicit about the limits: the terminal and MCP tools used by Agent cannot block access to ignored files, and complete protection isn't guaranteed.
3. MCP configuration and known CVEs
CVE-2025-54135 (Cursor below 1.3.9) let the agent create a missing .cursor/mcp.json without approval, which a prompt injection could chain into code execution. CVE-2025-54136 (fixed in 1.3) let an attacker with write access to a shared repo swap an already-approved MCP server for a malicious command without a new prompt. Both are fixed; keep Cursor updated and treat changes to MCP files in pull requests as security-relevant.
4. Auto-run and untrusted repositories
Terminal commands need approval by default; Run Modes can relax that, but Cursor calls them best-effort guardrails, not a hard boundary. Workspace trust is disabled by default; Cursor suggests a basic text editor for untrusted repos.
5. Open database rules
If the app uses Supabase from the browser, check RLS on every table: Supabase RLS check.
What the free FixMyVibe scan checks
Paste the URL of a public GitHub repository. The free scan reads the code read-only on a temporary copy that is deleted afterwards, and looks for:
- Hardcoded secrets in the current files: API keys, tokens, Supabase secret/service_role keys, private keys, and secrets exposed through
NEXT_PUBLIC_/VITE_variables or committed build output. - Supabase database rules in your committed SQL migrations: tables without RLS,
USING (true)/WITH CHECK (true)policies, policies that trustuser_metadata, and similar patterns.
What it does not do: it does not scan your git history (only the current files), it does not connect to your database or your live Cursor-built app, and it cannot see private repositories. Dependency checks against the OSV vulnerability database are part of the paid audits, not the free scan. It is an automated code scan, not a penetration test.
Pre-launch checklist
- Update Cursor to the latest version (at least 1.3.9 for the MCP fixes).
- Add secret paths (.env*, *.pem, credentials files) to .cursorignore or the global ignore list.
- Keep terminal commands on approval unless you understand the Run Mode you pick.
- Review new or changed MCP servers and .cursor/mcp.json changes before approving.
- Review diffs for hardcoded keys before every commit; rotate anything that was exposed.
- Check RLS on every Supabase table, then scan the repository.
FAQ
Can Cursor's agent read my .env file?
Cursor ignores .env* files by default and blocks files in .cursorignore from Agent, Tab, Inline Edit and @-mentions. But Cursor's docs say the terminal and MCP tools used by Agent cannot block access to ignored files, and that complete protection isn't guaranteed.
What were CVE-2025-54135 and CVE-2025-54136?
Two Cursor vulnerabilities around MCP configuration. CVE-2025-54135 (fixed in 1.3.9): the agent could create a new .cursor/mcp.json without approval, so a prompt injection could lead to code execution. CVE-2025-54136 (fixed in 1.3): an already-approved MCP server definition could be changed without re-approval. Update Cursor if you're on an older version.
Does Cursor ask before running terminal commands?
By default, yes. Cursor's docs say terminal commands need approval unless you configure Run Modes, and that Run Modes are best-effort guardrails, not a hard security boundary.
Does FixMyVibe check my Cursor setup?
No. The free scan checks the app code in a public GitHub repository for hardcoded secrets and Supabase RLS problems. It doesn't look at your editor, its settings or your MCP servers.
Sources
- Cursor docs: Agent security
- Cursor docs: Ignore file (.cursorignore)
- CVE-2025-54135 (CVE.org)
- Cursor advisory GHSA-4cxx-hrm3-49rm
- CVE-2025-54136 (CVE.org)
- Cursor advisory GHSA-24mc-g4xr-4395
FixMyVibe is an automated code scan, not a full penetration test, and cannot guarantee that an app is secure. What happens to your code during a scan: see our privacy policy.