Is Cursor Safe? Security Risks and the Checklist Before You Ship
Is Cursor safe to ship a real app on? The editor is fine — the code it generates can ship vulnerable. The Enrichlead story, the SSRF research, and a checklist.
You've been building fast with Cursor, and it's been a revelation. The AI writes whole features, you barely touch the keyboard, and the app comes together. But now you're getting close to putting it in front of real users, and a quiet doubt has set in: is Cursor safe to ship a real app on, or is the AI leaving security holes you can't see?
Good instinct. Cursor is a developer tool — it sits inside a real code editor, with roughly 7 million developers using it and about $2 billion in annual recurring revenue. Because it's an editor and not a no-code builder, you actually have more control over the code than you would on most platforms. That's a real advantage. But it cuts both ways: more control means more responsibility, and the AI will happily generate code that works and ships a vulnerability at the same time.
This post explains where the risks actually are, what happened to one app built entirely with Cursor, what the research says about AI-generated code in general, and a checklist to run before you launch.
⚡ TL;DR
- Cursor the editor is safe. The risk is that AI-generated code regularly ships vulnerabilities — and because you have full code control, securing it is on you.
- One Cursor-built app, Enrichlead, was reverse-engineered within about two days: paywall bypassed, API keys maxed out, junk written to the database. The founder shut it down.
- The most common gaps are missing access controls (like Supabase RLS), exposed secret keys, and server-side request forgery (SSRF). A 2025 study found every AI tool tested introduced SSRF and none set security headers.
Is Cursor safe? The short answer
Yes — and the question is slightly aimed at the wrong target.
Cursor is a polished, widely trusted editor. It isn't going to sabotage your code or smuggle in malware. When founders ask "is Cursor safe," what actually matters is a different thing: is the code Cursor writes for me secure? And the honest answer there is "not automatically."
AI models optimize for producing code that works. They are not optimizing for "an attacker cannot abuse this." Those are different goals, and the research backs it up: across large studies of AI-generated code, a substantial share of samples ship with a security flaw, and the functional pass rate is far higher than the security pass rate. In one benchmark, over 80% of functionally correct AI solutions still contained a vulnerability.
So Cursor is safe to use. The code it produces needs review before it goes live — the same as code from any junior developer working very, very fast.
The real risks when you build with Cursor
Because Cursor builds real applications across many stacks, the risk surface is broad. Here are the gaps that show up most.
Missing access controls (RLS and beyond)
If your Cursor app uses Supabase — a common choice, since Supabase is the default backend across the vibe-coding world — the central risk is RLS (Row Level Security). RLS is a per-user filter the database applies to every query, like an automatic WHERE clause deciding which rows each user can see. With RLS off, or set to a permissive USING (true) policy, anyone can pull the whole table through your app's public API.
This isn't Supabase-specific, though. Any backend Cursor wires up needs access checks on the server side — the rule that says "this user may only see their own orders." AI-generated code frequently skips that check because the feature works without it in testing. We cover the database side in depth in Supabase RLS explained.
Exposed secret keys
Cursor apps connect to paid services — payment processors, AI APIs, email. The danger is a secret key ending up in the frontend bundle that ships to the browser. Keep the distinction clear:
- A Stripe publishable key (
pk_live_...) and a Supabase anon key are meant to be public. Not emergencies. - A Stripe secret key (
sk_live_...), an OpenAI or Anthropic key, or a Supabase service_role key in client code is an emergency.
This is exactly how Enrichlead's keys got maxed out — which we'll get to. If your app calls a paid API directly from the browser, the secret is probably readable in your JavaScript. See exposed secrets and API keys in frontend code.
Server-side request forgery (SSRF) and missing headers
This one is more technical, and it's worth flagging because the research is striking. SSRF (Server-Side Request Forgery) is a flaw where an attacker tricks your server into making requests on their behalf — for example, reaching internal systems it shouldn't. In a December 2025 study of 15 AI-built apps across Cursor, Claude Code, Replit, Devin, and OpenAI Codex, every single tool introduced an SSRF vulnerability. The same study found that zero of the apps implemented CSRF (Cross-Site Request Forgery) protection and zero set security headers.
That doesn't mean every Cursor app is broken. It means these specific classes of bug are exactly what AI tends to miss, so they belong at the top of your review list.
What happened to Enrichlead
This is the cautionary tale, and it's instructive precisely because the app worked.
In March 2025, a founder shipped Enrichlead, an app built with Cursor and, by the founder's own description, "zero hand-written code." It launched, it functioned, it looked done. Then people started poking at it. Within roughly two days, attackers had bypassed the paywall (using the paid features without paying), maxed out the app's API keys (running up usage on the founder's accounts), and written garbage into the database. The founder shut it down.
The lesson isn't "Cursor is dangerous." Cursor did what it was asked: it built a working app. The lesson is that "working" and "secure" are different states, and the gap between them is where attackers live. The app had no real access controls, and its keys were reachable. Both are checkable before launch. We put this in context alongside other cases in the vibe-coding breach timeline.
How to check your Cursor app
Because you have full code access, you can check thoroughly. Budget fifteen minutes.
- Find your secret keys. Search your frontend bundle (browser dev tools → Sources, or your build output) for
sk_live,service_role, and any AI provider key prefix. None should be there. Move them to server-side environment variables. - Check your access controls. If you use Supabase, confirm RLS is enabled with real policies on every table holding user data — not
USING (true). For any other backend, confirm each data endpoint checks that the requesting user owns the data. - Look for SSRF surfaces. Anywhere your server fetches a URL the user supplied (image imports, webhooks, "fetch from link" features), confirm it validates and restricts the destination. This is the single most likely AI-introduced flaw.
- Test as a real attacker would. Try to access another user's data, or hit a paid feature without paying. If it works for you, it works for anyone.
- Confirm security headers and CSRF protection exist in your deployed app.
Not sure if your Cursor app has this exact issue?
Run a free, read-only scan of your live app — no install, results in under a minute.
Scan my app free →The pre-ship checklist for Cursor
Run this before real users touch your app.
- No secret keys in the frontend: no
sk_live_..., noservice_role, no raw AI provider keys in client code. - Access controls on every endpoint: RLS enabled with real policies on Supabase tables, or owner-checks on every server route.
- SSRF guarded: any user-supplied URL your server fetches is validated against an allowlist.
- CSRF protection enabled on state-changing requests.
- Security headers set in your deployed app.
- Tested adversarially: you've personally tried to read another user's data and to bypass payment, and confirmed you can't.
A useful prompt to give Cursor: "Review this code for security issues before deployment: check that no secret keys are in client-side code, that every data access checks the requesting user owns the resource, and that any server-side fetch of a user-supplied URL is restricted to an allowlist."
FAQ
Is Cursor safe for beginners with no security background?
Cursor is safe to use, but it won't make your app secure on its own — and beginners are most at risk because they may not know what to check. The good news is that the highest-impact checks (no secret keys in the frontend, access controls on every data table, SSRF guards) are concrete and learnable. Run them, or run a scanner that runs them for you, before you ship.
Does Cursor write secure code?
Cursor writes code that works. Whether it's secure depends on the task and your review. Studies of AI-generated code consistently find a meaningful share of samples ship with a vulnerability — and in one benchmark over 80% of functionally correct solutions still had a security flaw. Treat AI output like a fast junior developer's work: useful, but it needs a security review.
What's the most common security mistake in Cursor apps?
Missing access controls and exposed secret keys lead. If your backend is Supabase, missing or USING (true) RLS is the top one; across stacks, secret keys leaking into the frontend and SSRF in server-side fetches are close behind. A December 2025 study found every AI tool tested introduced SSRF.
The bottom line
Cursor is safe to build with, and it gives you more control than most platforms — which is exactly why securing the output is your job. The editor isn't the risk; the code is, because AI optimizes for "it works," not "it's locked down." Enrichlead worked perfectly and was dismantled in two days. An attacker can find your missing access control or exposed key in minutes. The point is to find it first, and to keep checking, because every new feature Cursor writes is new code that needs the same review.
Find your gaps before an attacker does.
Is My Site Hackable? scans your deployed app for the exact issues in this article — exposed keys, missing RLS, open buckets — and tells you what's real and what's a false alarm.
Run a free scan →