{"slug": "vibe-coded-apps-are-easy-to-build-hardening-them-is-the-real-work", "title": "Vibe-Coded Apps Are Easy to Build. Hardening Them Is the Real Work.", "summary": "A scan of 159,041 Lovable projects by German security firm Crissy Field, working with Handelsblatt, found that 24,664 of the 34,545 projects using Supabase returned database records to a visitor with no login, exposing email addresses on 7,403 sites, more than 1,000 passport records in one provider's database and over 200,000 chat messages from a single forum. The researchers used only read requests and the key every page hands to the browser, attributing the exposure to missing row-level security rather than a platform hack; Lovable's head of security confirmed insufficient row-level security as the root cause, which he said the platform's scanner is built to catch. The finding sits alongside UpGuard's discovery of roughly 16,000 exposed Supabase-hosted databases in September, RedAccess's finding of about 5,000 exposed AI-built apps in May, and Wiz's February discovery of a misconfigured database at Moltbook that exposed about 1.5 million authentication tokens and 35,000 email addresses.", "body_md": "**TL;DR:** AI tools made it cheap to build an app that *works*. They did not make it cheap to build one that is *safe*. The 2026 breaches were rarely clever: open databases, secrets in the browser, missing authorization, and agents holding credentials they never needed. The fix is a short list of boring controls, applied before real users arrive.\n\n## The demo works. That's the trap.\n\nA prompt, a few iterations, a login screen, a database, a deploy button. The app does exactly what you asked.\n\nThe trouble is everything you didn't ask for:\n\n- Who may read this row?\n- What happens if a stranger calls this endpoint directly?\n- Where does the API key live?\n- What can the agent delete?\n\nModels optimize for \"it runs.\" Attackers test everything else.\n\n## What went wrong in 2026\n\n```\ntimeline\n    title Vibe-coding security incidents, 2026\n    section Early warnings\n        Feb : Moltbook database exposes about 1.5M auth tokens\n        Mar 24 : UK NCSC warns about vibe-coding risk at RSAC\n    section Agents and defaults\n        Apr 24 : Coding agent deletes PocketOS production data and backups\n        May : RedAccess finds about 5,000 exposed AI-built apps\n        May 30 : Supabase makes new tables opt-in to its Data API\n    section The scale shows\n        Sep 25 : UpGuard finds about 16,000 exposed Supabase databases\n        Nov 2 : Crissy Field and Handelsblatt report on open Lovable apps\n```\n\n**Lovable apps (November).** German security firm Crissy Field, working with Handelsblatt, scanned 159,041 Lovable projects. Of the 34,545 that used Supabase, 24,664 returned database records to a visitor with no login.\n\nWhat was readable:\n\n- Email addresses on 7,403 sites\n- 1,000+ passport records in one provider's database\n- 200,000+ chat messages from a single forum\n\nThe researchers used only read requests and the key every page already hands to the browser. The cause was missing row-level security, not a hack of the platform.\n\n**Fair caveat:** the sample isn't representative of all Lovable apps, and some of the exposed data was meant to be public. Lovable calls it an industry-wide Supabase configuration problem. Its head of security later confirmed the root cause was insufficient row-level security, which he said the platform's scanner is built to catch.\n\n**Supabase at large (September).** UpGuard found around 16,000 Supabase-hosted databases exposing some personal data. Supabase says security is a shared responsibility.\n\n**Public by default (May).** RedAccess found about 5,000 apps built with tools like Lovable, Replit, Base44 and Netlify exposing corporate or personal data. Roughly 2,000 held sensitive data with no authentication.\n\nSome tools made apps public unless the builder switched them to private. The platforms argued that a reachable app isn't automatically a breach. Fair, but it means the builder has to decide.\n\n**Moltbook (February).** Wiz found a misconfigured database behind a vibe-coded social network for AI agents. It exposed about 1.5 million authentication tokens and 35,000 email addresses.\n\n**PocketOS (April).** A Cursor agent running Claude Opus 4.6 hit a credential mismatch on a staging task, found an infrastructure token with broad permissions, and deleted a Railway volume.\n\nThe production database and its backups went with it in about nine seconds. Railway later restored the data. The agent had ignored the project's rule against destructive commands.\n\nNone of these needed an exploit. They needed a browser, a `curl`, or a token lying around.\n\n## Why it keeps happening\n\n### 1. Models are good at rules and bad at context\n\nTenzai had five coding agents (Cursor, Claude Code, Codex, Replit, Devin) build the same three apps. It found 69 vulnerabilities across the 15 apps.\n\n| Agents usually handle | Agents usually miss | \n|---|---|\n| Well-known pitfalls with a clear fix, like SQL injection and XSS (none exploitable in Tenzai's tests) | Authorization on every API endpoint | \n| Code that compiles and runs (near-100% in Veracode's tests) | SSRF: all five agents introduced it in a test built to tempt it | \n|  | Business rules: four of five accepted negative order quantities | \n|  | Security controls nobody asked for | \n\nThe last row matters most. In almost all cases the agents didn't implement those controls badly. They skipped them.\n\nRaw-model benchmarks still show XSS failures, so results depend on the setup. The pattern holds either way: familiar mistakes get avoided, app-specific ones don't.\n\n### 2. Security is improving, slowly\n\nVeracode's October 2026 report put AI code at a 62% security pass rate, up from a stalled 56%. The best models hit 73%, the weakest 44-50%.\n\nThat still means roughly four in ten test tasks produce vulnerable code on average. It's a vendor benchmark, not a verdict on your app.\n\nGeorgia Tech's Vibe Security Radar tracks CVEs traceable to AI-authored code. It counted 6 in January 2026, 15 in February and 35 in March, for 74 in total since May 2025. That is the latest public tally I could find.\n\nThe researchers call these counts a floor, because most AI code carries no attribution.\n\n### 3. Defaults and permissions set the blast radius\n\nSupabase's anon key is public by design. Policies and grants decide what it can reach.\n\n```\nflowchart TB\n    subgraph sgOpen[\"Without row-level security\"]\n        direction LR\n        A1[\"Visitor copies the public<br/>anon key from the JS bundle\"] --> A2[\"Calls the Data API<br/>directly\"] --> A3[\"Table has no policy\"] --> A4[\"Every row returned\"]\n    end\n    subgraph sgLocked[\"With deny-by-default policies\"]\n        direction LR\n        B1[\"Same visitor,<br/>same key\"] --> B2[\"Calls the Data API<br/>directly\"] --> B3[\"Policy checks<br/>auth.uid() = user_id\"] --> B4[\"Own rows only,<br/>or nothing\"]\n    end\n    sgOpen ~~~ sgLocked\n    classDef danger fill:#fee2e2,stroke:#ef4444,color:#7f1d1d\n    classDef safe fill:#dcfce7,stroke:#22c55e,color:#14532d\n    class A1,A2,A3,A4 danger\n    class B1,B2,B3,B4 safe\n```\n\nSupabase has since made new tables in `public` opt-in to the Data API. That became the default for new projects on May 30, 2026, and was scheduled to reach existing projects on October 30, 2026.\n\nIt covers new tables only. Tables you already have keep their grants, so audit them yourself.\n\nThe PocketOS token had the same shape of problem: far more power than the task needed.\n\n### 4. Nobody owns the review\n\nThe UK's NCSC said at RSAC in March that vibe coding is a chance to make software more secure, but only if safeguards are built in from the start. It described the current risk as intolerable for many organizations.\n\n## The hardening checklist\n\n```\nflowchart LR\n    D[\"<b>Design</b><br/>Threat model<br/>Who reads, writes<br/>and deletes what\"] --> B[\"<b>Build</b><br/>Deny-by-default access<br/>Secrets server-side<br/>Vetted auth\"]\n    B --> G[\"<b>Gate</b><br/>SAST and secret scans<br/>Dependency audit<br/>Human review\"]\n    G --> T[\"<b>Test</b><br/>Smoke tests on staging<br/>Cross-user checks\"]\n    T --> O[\"<b>Operate</b><br/>Logs and alerts<br/>Tested backups<br/>Security contact\"]\n    classDef d fill:#dbeafe,stroke:#3b82f6,color:#1e3a8a\n    classDef b fill:#ede9fe,stroke:#8b5cf6,color:#4c1d95\n    classDef g fill:#fef3c7,stroke:#f59e0b,color:#78350f\n    classDef t fill:#ffedd5,stroke:#f97316,color:#7c2d12\n    classDef o fill:#dcfce7,stroke:#22c55e,color:#14532d\n    class D d\n    class B b\n    class G g\n    class T t\n    class O o\n```\n\n### 1. Authorization first\n\nThis is where most of the damage is. Deny by default, then open up deliberately.\n\n```\n-- Lock the table down\nalter table public.orders enable row level security;\n\n-- Expose only what the app needs, only to the roles that need it\ngrant select, insert on public.orders to authenticated;\n\n-- Users see and create only their own rows\ncreate policy \"orders: read own\"\n  on public.orders for select to authenticated\n  using ((select auth.uid()) = user_id);\n\ncreate policy \"orders: insert own\"\n  on public.orders for insert to authenticated\n  with check ((select auth.uid()) = user_id);\n```\n\n- No `anon` grants unless logged-out access is the point of that table.\n- Check ownership on every server endpoint, not only in the UI. IDOR/BOLA is the classic miss.\n- Enforce business rules on the server: positive quantities, prices from your database, not the request.\n- Keep storage buckets private by default. The `service_role` key never ships to a client.\n\n### 2. Keep secrets off the client\n\n- Anything in the JS bundle is public. Call paid APIs (LLMs, email, payments) from the server, with rate limits and spend caps.\n- Turn on secret scanning and push protection. GitGuardian counted 28.65 million new hardcoded secrets in public GitHub commits in 2025, up 34%.\n- Rotate any key that ever touched a repo, a screenshot or a chat.\n\n### 3. Don't let the model hand-roll auth\n\n- Use a vetted provider or framework for sessions, password reset, OAuth and MFA.\n- Rate-limit and lock out login and reset endpoints.\n- Require MFA on admin accounts.\n\n### 4. Validate input and outbound requests\n\n- Validate every request body against a schema (Zod, Pydantic) and use parameterized queries.\n- Guard server-side fetches: allowlist destinations and block private and metadata IP ranges.\n- Add the controls agents tend to skip: security headers (Helmet for Express, for example), CORS limited to your origins, CSRF protection for cookie sessions, upload type and size checks.\n\n### 5. Verify your dependencies\n\nModels invent package names. One 2025 study found about one in five AI-suggested packages didn't exist. Attackers register those names (\"slopsquatting\").\n\n- Confirm every new package is real and maintained.\n- Commit lockfiles and pin versions.\n- Run an audit in CI.\n\n### 6. Constrain agents and infrastructure\n\n```\nflowchart TB\n    subgraph sgBefore[\"PocketOS: what happened\"]\n        direction LR\n        P1[\"Agent works on<br/>a staging task\"] --> P2[\"Hits a credential<br/>mismatch\"] --> P3[\"Finds a token with<br/>broad API permissions\"] --> P4[\"One call deletes the volume<br/>and its backups\"]\n    end\n    subgraph sgAfter[\"What limits the blast radius\"]\n        direction LR\n        Q1[\"Agent gets a<br/>staging-only token\"] --> Q2[\"Destructive call on<br/>production is denied\"] --> Q3[\"Deletes need<br/>human confirmation\"] --> Q4[\"Backups live in a<br/>separate account\"]\n    end\n    sgBefore ~~~ sgAfter\n    classDef danger fill:#fee2e2,stroke:#ef4444,color:#7f1d1d\n    classDef safe fill:#dcfce7,stroke:#22c55e,color:#14532d\n    class P1,P2,P3,P4 danger\n    class Q1,Q2,Q3,Q4 safe\n```\n\n- Give agents least-privilege, environment-scoped tokens. Never hand a coding agent production credentials.\n- Require human confirmation for destructive actions.\n- Keep backups outside the blast radius and test a restore.\n\n**Rule of thumb:** a rule in a prompt is a request. A permission is a control.\n\n### 7. Put gates in the pipeline\n\n- Run SAST, secret scanning and dependency scanning on every pull request.\n- Run a dynamic scan or quick pentest against staging before launch.\n- Keep AI-generated PRs small enough for a human to actually read.\n- Treat built-in platform scanners as a floor, not a sign-off.\n\n### 8. Operate like it's real\n\n- Log auth events and access to sensitive tables, and alert on anomalies.\n- Know what personal data you hold. If you store passports or health records, you carry the obligations however the app was built.\n- Publish a security contact ( `/.well-known/security.txt` ) and answer reports.\n\n## A 15-minute pre-launch smoke test\n\n1. **Anonymous read.** Request your tables with only the public key. You want an error or an empty array, never rows.\n2. **Cross-user access.** Log in as user B and request user A's record IDs. Expect denial.\n3. **Bundle search.** Search your built assets for secrets.\n4. **Abuse paths.** Submit a negative quantity and a zero price. Point any URL-fetching feature at`http://169.254.169.254/` .\n5. **Blast radius.** List every token your agent or CI can reach. Remove what it doesn't need.\n\nCommands for steps 1 and 3:\n\n```\n# Step 1: anonymous read with the public anon key\ncurl \"https://<project>.supabase.co/rest/v1/<table>?select=*&limit=5\" \\\n  -H \"apikey: <ANON_KEY>\" -H \"Authorization: Bearer <ANON_KEY>\"\n\n# Step 3: look for secrets in the built bundle\ngrep -rEi \"sk-[a-z0-9]|service_role|secret\" dist/\n```\n\n## The takeaway\n\nBuilding got cheap. Being responsible for what you built didn't.\n\nA vibe-coded app is a first draft from a fast, confident junior engineer who has never seen your threat model. Write that threat model down. Put the controls in code and permissions, not in prompts. Make \"safe enough to hold other people's data\" part of your definition of done.\n\n## Sources\n\n- Crissy Field research on Lovable apps: [https://www.crissyfield.de/research/lovable-en/](https://www.crissyfield.de/research/lovable-en/) and[Cybernews coverage](https://cybernews.com/security/lovable-ai-apps-expose-personal-information/)\n- Lovable's security response: [Hacker News thread](https://news.ycombinator.com/item?id=50502105)\n- UpGuard Supabase findings, via [TechCrunch](https://techcrunch.com/2026/09/25/some-supabase-customers-are-publicly-exposing-reams-of-peoples-data-to-the-web/)\n- Supabase [changelog on Data API exposure](https://supabase.com/changelog/45329-breaking-change-tables-not-exposed-to-data-and-graphql-api-automatically)\n- RedAccess report, via [Security Boulevard](https://securityboulevard.com/2026/05/thousands-of-vibe-coded-apps-exposing-corporate-personal-data-redaccess/) and[Axios](https://www.axios.com/2026/05/07/loveable-replit-vibe-coding-privacy)\n- Moltbook exposure: [Wiz](https://www.wiz.io/blog/exposed-moltbook-database-reveals-millions-of-api-keys) and[Infosecurity Magazine](https://www.infosecurity-magazine.com/news/moltbook-exposes-user-data-api/)\n- PocketOS incident: [IBM](https://www.ibm.com/think/news/how-to-manage-AI-agents) and[Tom's Hardware](https://www.tomshardware.com/tech-industry/artificial-intelligence/victim-of-ai-agent-that-deleted-companys-entire-database-gets-their-data-back-cloud-provider-recovers-critical-files-and-broadens-its-48-hour-delayed-delete-policy)\n- Tenzai agent test: [SecurityWeek](https://www.securityweek.com/vibe-coding-tested-ai-agents-nail-sqli-but-fail-miserably-on-security-controls/)\n- Veracode GenAI Code Security Report, [October 2026 update](https://www.veracode.com/?p=33104)\n- Georgia Tech Vibe Security Radar: [The Register](https://www.theregister.com/2026/03/26/ai_coding_assistant_not_more_secure/)\n- NCSC at RSAC 2026: [NCSC](https://www.ncsc.gov.uk/news/ncsc-ceo-seize-disruptive-vibe-coding-opportunity-to-make-software-more-secure)\n- GitGuardian State of Secrets Sprawl 2026 and slopsquatting figures, as summarized by the [Cloud Security Alliance](https://labs.cloudsecurityalliance.org/research/csa-research-note-ai-generated-code-security-vibe-coding-202)", "url": "https://wpnews.pro/news/vibe-coded-apps-are-easy-to-build-hardening-them-is-the-real-work", "canonical_source": "https://zyvop.com/vibe-coded-apps-are-easy-to-build-hardening-them-is-the-real-work-3k1l5", "published_at": "2026-11-27 05:02:32+00:00", "updated_at": "2026-11-27 05:12:13.022767+00:00", "lang": "en", "topics": ["ai-safety", "ai-agents", "ai-tools", "ai-products"], "entities": ["Lovable", "Supabase", "Crissy Field", "Handelsblatt", "UpGuard", "RedAccess", "Wiz", "Moltbook"], "also_reported_by": [], "takeaway": "Apps built with AI tools ship with Supabase row-level security off by default, so 24,664 of 34,545 scanned Lovable projects leaked records to unauthenticated read requests using only the public browser key.", "recommendation": {"advice": "Enable row-level security on every Supabase table and test each endpoint with the public anon key before launch; 24,664 of 34,545 scanned Lovable projects leaked data without any exploit.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/vibe-coded-apps-are-easy-to-build-hardening-them-is-the-real-work", "markdown": "https://wpnews.pro/news/vibe-coded-apps-are-easy-to-build-hardening-them-is-the-real-work.md", "text": "https://wpnews.pro/news/vibe-coded-apps-are-easy-to-build-hardening-them-is-the-real-work.txt", "jsonld": "https://wpnews.pro/news/vibe-coded-apps-are-easy-to-build-hardening-them-is-the-real-work.jsonld"}}