ContactBook a call

Security

Cursor app security review: what to check

Reviewing an app built with Cursor: secrets in the repo, auth on API routes, hallucinated packages, rules file and MCP injection, and the 2025 Cursor CVEs.

Cover for “Cursor app security review: what to check”, with the line: Review the app, the packages it pulled in, and the files that tell the editor what to do.
Review the app, the packages it pulled in, and the files that tell the editor what to do. Image: SBD.

A security review of an app written with Cursor covers three things. The first is the app itself: secrets committed to the repository, API routes that do not check who is calling, and database rules. The second is the packages the AI added, because language models sometimes suggest package names that do not exist and attackers register them. The third is the editor setup, meaning Cursor rules files and MCP servers, which can carry hidden instructions and were the subject of two Cursor vulnerabilities fixed in 2025. A founder can run most of the checks below in an afternoon.

Cursor is an editor, so an app built with it can look like anything: Next.js on Vercel, a Python API, a Supabase front end. That makes the review broader than for Bolt or Replit, where the platform decides much of the stack. This post goes through the checks in the order we would run them.

The short answer

Scan the git history for secrets and rotate anything found. Open every API route and confirm it checks the session and the user's right to the record. Check each dependency exists, is the package you meant, and has real usage. Read your .cursor/rules files and mcp.json as you would code, and keep Cursor updated.

Secrets in the repository

Cursor writes code fast, and when you paste a key into chat to get something working, it often ends up in a file. Once committed, the key stays in git history even after you delete the line.

Check: run a secret scanner such as gitleaks detect or trufflehog git file://. over the whole repository, history included. GitHub’s secret scanning does the same for repositories hosted there. Anything it finds should be rotated at the provider, because removing it from the code does not un-leak it.

Also check the front end. In Next.js, any variable starting with NEXT_PUBLIC_ is sent to the browser, and in Vite the prefix is VITE_. Build the app and search the output for key prefixes like sk_, sk- and re_.

Auth on every API route

A common serious bug in AI-written code is an API route that works but does not check who is calling. The model writes a handler that takes an id from the request and returns the record. Without a check that the signed-in user owns that record, anyone can read anyone’s data by changing the id.

Check: list every route (in Next.js, everything under app/api or pages/api, plus server actions). For each one, find the line that reads the session and the line that checks the user may touch this record. If either is missing, it is a finding. Middleware that blocks logged-out users is useful, but it does not check ownership.

If the app uses Supabase from the browser, row-level security does this job at the database. The test is in Your Lovable app is probably public, and it applies to any Supabase app.

Hallucinated packages and slopsquatting

Language models sometimes suggest installing packages that do not exist. A study presented at USENIX Security 2025 by Spracklen and colleagues tested 16 code models and found that 19.7% of generated samples referenced at least one package that did not exist, with open-source models far more prone to it than commercial ones. Many of those invented names came up again when the same prompt was repeated, which makes them predictable. Registering a package under a name models tend to invent, so that it gets installed by people following AI suggestions, has been called slopsquatting.

The study’s samples were largely generated by asking models what to install, so the figure is a measure of model behaviour rather than a rate you should expect in your own repository. The risk is still worth ten minutes.

Check: go through package.json or requirements.txt. For each dependency you do not recognise, look it up on npm or PyPI: does it have a real repository, a history of releases and meaningful download numbers? A package published recently with almost no downloads and a name close to a popular one deserves a closer look. Run npm audit or pip-audit for known vulnerabilities, and commit your lockfile so installs are repeatable.

Rules files and MCP servers

Cursor reads instructions from rules files in the project and can connect to MCP servers that give the AI tools such as database access or Slack. Both are inputs the model acts on, so both can carry prompt injection.

In March 2025, Pillar Security described a “Rules File Backdoor”: hidden Unicode characters in a rules file can carry instructions a person reviewing the file does not see, and in their demonstration the assistant added a script tag to generated HTML. Pillar reported that Cursor’s response was that managing this risk is the user’s responsibility.

Two CVEs followed in mid 2025, both involving MCP configuration:

  • CVE-2025-54135 (CurXecute), found by Aim Labs. A prompt injection arriving through an MCP server, for example a message in Slack, could get the agent to write to the MCP configuration file and run commands without the user approving them.
  • CVE-2025-54136 (MCPoison), found by Check Point Research. Once a user had approved an MCP server in a shared repository’s config, an attacker could change its command later without a new approval prompt.

Both were fixed in the Cursor 1.3 line released in late July 2025 (Tenable lists 1.3.9 as the fixed version for CVE-2025-54135). Cursor now asks for approval again when an MCP entry changes.

Check: update Cursor and confirm you are on 1.3.9 or later. Read every file in .cursor/rules and any .cursorrules file, and scan them for invisible characters (grep -P '[\x{200B}-\x{200F}\x{202A}-\x{202E}\x{2066}-\x{2069}]' finds the usual ones). Open .cursor/mcp.json and the global MCP config and remove servers you do not use. Treat changes to these files in pull requests as code changes that need review. Be careful about connecting MCP servers that read content strangers can write, such as public Slack channels, issue trackers or inboxes, to an agent that can also run commands.

What else belongs in a full review

Beyond the four areas above, a production review should look at rate limits on sign-up, login and AI endpoints, how errors are logged (and whether logs contain personal data), backups and restore, and whether file uploads are checked for type and size. If the app was started in another tool before moving into Cursor, review the original platform’s setup too: see Is my Bolt.new app secure? and Replit app to production.

Getting it reviewed

Our vibe-coded app audit covers all of the above for Cursor apps, starts at $500, and ends with a written report within a week, ordered by risk. If you want the fixes done, Harden starts at $1,000. Rebuild starts at $8,000 for apps whose structure makes fixing route by route more expensive than starting the server layer again. For Supabase-backed apps, our Supabase integration page shows how we set up the database side.

Questions we get asked

Is Cursor itself safe to use?

Cursor has had vulnerabilities and fixed them, like most editors. Keep it updated, review rules files and MCP config as code, and be selective about which MCP servers you connect. The larger risk for most founders is in the app the editor produced.

I deleted the key from the file. Do I still need to rotate it?

Yes, if it was ever committed or pushed. It remains in git history, and anyone with a copy of the repository can find it.

Does npm audit catch slopsquatting?

Not reliably. npm audit reports known vulnerabilities in published packages. A newly registered malicious package may have no advisory yet. Checking that each dependency is the one you meant is a separate step.

Should I stop using AI-suggested packages?

No. Check the name before you install it, prefer well-known packages, and keep a lockfile. The study found most hallucinated names were not near-misses of real ones, so they are easy to spot once you look.

Sources and further reading

  • Cursor
  • Vibe coding
  • Security
  • MVP audit

Keep reading

Cover for “Is my Bolt.new app secure? The checks to run”, with the line: The database is reachable from the browser, so the rules on each table decide who sees what.

Security

Is my Bolt.new app secure? The checks to run

How to check a Bolt.new app before launch: row-level security on Supabase or Bolt Database, keys in the bundle, Netlify secrets and the Security page.

Cover for “Replit app to production: a checklist”, with the line: Keep the agent working on a copy, and keep production somewhere it can only read.

Security

Replit app to production: a checklist

Taking a Replit Agent app live: separate dev and production databases, production secrets, backups, and what the July 2025 database deletion taught.

Cover for “Exposed API keys in AI-built apps: find and fix them”, with the line: A key in browser code belongs to everyone who opens the page, and deleting it later does not take it back.

Security

Exposed API keys in AI-built apps: find and fix them

How API keys leak from Lovable, Bolt, v0, Replit and Cursor apps, how to search your bundle and Git history for them, and how to rotate and move them safely.

Find out what is worth automating

About 95% of AI pilots never reach the profit line. We start with the work your team still does by hand and measure each build by the hours it saves.

See how we work

Cookie preferences

Choose what this site may use on your device. You can change this at any time from “Cookie settings” in the footer.

Strictly necessary

Keep the site working and remember the choices you make here. These cannot be switched off, and none of them track you.

Always on
What this includes (4)
NameProvider PurposeDuration
sbd-consentThis site Remembers your cookie choices12 months
Vercel Web AnalyticsVercel Inc. Counts page views in aggregate. Sets no cookie and stores nothing on your deviceNone
ticker-dismissed, sbd-note-offThis site Remembers that you closed a notice or language tipUntil the tab closes
sbd-voice-resume, sbd-voice-prefillThis site Carries a voice conversation across pages, only if you start oneUntil the tab closes

Analytics

Tell us which pages are read and where visitors leave, so we can improve them. IP addresses are anonymised and nothing is used for advertising.

What this includes (2)
NameProvider PurposeDuration
_gaGoogle Analytics (Google LLC) Distinguishes visitors with a random ID13 months
_ga_FPXDMQPRV1Google Analytics (Google LLC) Keeps the session state for this site13 months

Functional

Embedded services that set their own cookies. Without them the site still works; you get a link to open the service instead.

What this includes (1)
NameProvider PurposeDuration
Booking calendarCal.com Inc. Shows live availability and books the call on the booking pageSet by Cal.com

Advertising

Not used. This site has no advertising, retargeting or social media tracking, and we never sell data.

Not used

Questions about your data: hello@smallbaydigital.com