VelifyGet early access
← All postsJun 19, 2026

Any website can read your users' data

AI sets CORS to allow any origin with credentials — so a malicious site can call your API as a logged-in user and read their data. The one-line fix.

Any website can read your users' data

AI set up CORS so your frontend can call your API. It works, you shipped. What you actually shipped lets any website call your API with your users’ cookies attached.

What you shipped

The config sets origin: '*' together with credentials: true — meaning any site can make authenticated requests on your users’ behalf.

Spot the bug

How anyone exploits it

A user visits evil.com while logged into your app. That page runs:

fetch('https://yourapi.com/me', { credentials: 'include' })

The browser sends your user’s cookies, your API allows the origin, and evil.com reads the response — the user’s private data, as them.

Why you won’t catch it

Your own frontend is an allowed origin (everything is), so all your testing works perfectly. The hole only matters when a different site makes the call.

Why AI does it

A wildcard origin is the fastest way to stop CORS errors during development. Pinning it to your real domain is the step that gets skipped once “it works.”

The fix

Name your exact origin(s); never combine * with credentials:

cors({ origin: 'https://yourapp.com', credentials: true })

The fix

Check your app

  • origin is an explicit allowlist of your domains, never * when credentials are involved.
  • Only the methods and headers you need are allowed.
  • Preflight responses don’t reflect arbitrary origins back.

The bigger problem

A senior dev catches this by reflex. But if nobody senior reads the code, the broken version ships — it works in every test, because every test takes the happy path. The author and the reviewer are the same model with the same blind spot.

That’s the gap Velify is built to close: it reads your project and flags exactly this, in plain language, no terminal.

Join the early list at getvelify.app →

Ship AI-built code with confidence.

Velify catches what a senior developer would — before you ship.

Get early access →
Velify© 2026 Velify. All rights reserved.