Free check

Guide · Cursor

Cursor security check: what to review before you ship

Cursor writes what you ask for. Ask for an endpoint and you get an endpoint that works, and nobody asked it to check who is calling. Here are the mistakes it makes most often, how to review for them, and a rules file that makes it stop.

Free instant check, no sign-up. No app at hand? See the report on our demo app, which we broke on purpose.

Why Cursor apps leak in their own way

Cursor is an editor, not a platform. There are no built-in guard rails: the stack, the hosting and every protection are whatever ended up in your code. Most projects are Next.js on Vercel with Supabase, Firebase or a Postgres database behind an ORM, so the examples below use Next.js. The same mistakes appear in every stack.

The six mistakes we see most often

1. API routes and server actions with no login check

A file under app/api/ is a public address. So is every server action: it is an endpoint anyone can call, even if the only button that uses it sits on an admin page. Each one needs its own check.

export async function GET() {
  const session = await auth();
  if (!session) return new Response('Unauthorized', { status: 401 });
  // return only this user's data
}

2. Protection only in middleware

Middleware that redirects visitors without a session protects pages. It is easy to leave an API path out of its matcher, and a bug in the framework's middleware has let requests skip it before. Treat middleware as a convenience and check the user again inside the route.

3. Secrets in NEXT_PUBLIC_ variables

Every variable whose name starts with NEXT_PUBLIC_ is copied into the page code. Cursor adds the prefix to make an "undefined" error go away, and the key becomes public.

4. Checking the login but not the owner

The route checks that someone is signed in, then loads the record by the ID from the address. Change the ID and you get another user's record. The query has to include the user: where: { id, userId: session.user.id }.

5. The server trusts the request body

Passing the whole body into an update lets a user set fields they should not, such as role or plan. Pick the allowed fields by name and validate them.

6. The database is open from the browser

With Supabase or Firebase, the browser talks to the database with a public key. Cursor writes the queries, but the access rules live in the database, and it cannot see whether they exist.

Review before you ship

  1. List every public address. Search the project for route.ts and "use server". For each file, find the line that checks the user. No such line means it is open.
  2. Search for public secrets. Search for NEXT_PUBLIC_ and read the list. Only values that are safe to show belong there.
  3. Check the built site, not only the code. Open the live app, press F12, open Sources and search all files for sk-, sk_live and service_role.
  4. Open your API as a stranger. In a private window, paste each API address into the address bar.
  5. Check what you committed. Run git log --all --full-history -- .env. If it prints anything, the file is in your history and its keys need rotating.
  6. Check the database rules. Supabase RLS checker · Firebase rules check.

A rules file that makes Cursor avoid these

Cursor reads project rules before it writes code. Save this as .cursor/rules/security.mdc (or add it to your existing rules) so every new endpoint starts out protected:

---
description: Security rules for every server-side change
alwaysApply: true
---
- Every API route and server action checks the signed-in user first and returns 401 without one. Middleware is not enough.
- Every query for user data filters by the signed-in user's ID taken from the session, never from the request.
- Never put a secret in a NEXT_PUBLIC_ or VITE_ variable, and never call a paid API from client code.
- Never pass a request body straight into a database write. Pick allowed fields by name and validate them.
- The server decides prices, plans, roles and payment status. Ignore them if the client sends them.
- Never return password hashes, tokens or other users' emails in a response.
- When adding a table to Supabase, enable Row Level Security and write policies in the same change.

A prompt to audit what is already there

Audit this project for security. List every API route and server action with: whether it checks the signed-in user, whether it checks that the record belongs to that user, and which fields from the request it writes to the database. Then list every NEXT_PUBLIC_ variable and say whether it is safe to be public. Fix what is unsafe and show me the changes file by file.

What the ShipProof check covers

A code review sees your intentions; a check from outside sees what the server actually does. The free check opens your live app the way a stranger would and finds secret keys in the page code, downloadable source maps, unsafe login cookies and missing browser protections.

The full check runs after you prove the app is yours by adding one tag to your home page. It opens the API addresses your pages use without a login and reports the ones that answer, tries to read your Supabase tables or Firebase collections with the public key, and looks for an exposed .env file and .git folder. Every request is read-only, and reports keep field names, never your data.

Mistakes 4 and 5 need real accounts, so test those by hand. No check can prove an app is secure; this one finds the common mistakes that are easiest to exploit.

Check what your app shows a stranger

A grade and the problems in plain language in a few seconds.