Coding agent

How to security test an app built with Bolt

Updated

Bolt apps often enforce authorization in the React component rather than in the data layer, so the check disappears the moment someone calls the API directly. Test by reading the bundle for keys and by calling every data path without the UI.

Where this class of bug actually lives in a Bolt app

  • Client-side gates. A route rendered conditionally in React is not an access check; the data request still goes out.
  • Keys in the bundle. Any VITE_ or NEXT_PUBLIC_ variable is public, including third-party API keys and service keys.
  • Backend-less storage. localStorage and IndexedDB hold tokens and records that any script on the page can read.
  • Third-party calls from the browser. An API key used client-side to call a paid service directly is an unlimited free tier for whoever finds it.

What to try first

  1. Grep the built bundle for key prefixes and for service_role, sk_, AIza, sk-live.
  2. Call the data endpoints directly, skipping the UI, with no session and with another user's token.
  3. Check whether the token lives in localStorage and what a stored-XSS payload could read.
  4. Test every third-party key found with a read-only call to that vendor.

A reproduction you can keep

The bundle is public. Read it before anyone else does:

What the bundle ships
curl -sS https://yourapp.com/assets/index-*.js \
  | grep -oE '(sk-|sk_live|AIza|service_role|SUPABASE_SERVICE)[A-Za-z0-9_-]{8,}' \
  | sort -u

# and the direct data call, no UI
curl -sS 'https://<backend>/api/records?select=*' \
  -H 'Authorization: Bearer <token-from-localStorage>'

# vulnerable: a live vendor key, and rows belonging to other users
# fixed: no secret keys in the bundle, and the backend scopes by the caller

What "fixed" has to look like

Move every secret server-side behind a function that authenticates the caller, and enforce authorization in the data layer rather than the component. Verify by re-grepping the bundle and by calling the data path with another user's token.

Where people get this wrong

  • A hidden route is not a protected route. The component is a render decision.
  • An .env value prefixed for the client is compiled into the bundle, which means it is published, not configured.
  • Rate limiting a browser-side key is impossible; rotating it is the only remedy.

What Offense does here

Offense runs an agent swarm against your app in a disposable sandbox, keeps the request, the identity and the vulnerable response as evidence, and replays the same attack after the fix so the retest is a control comparison rather than a green check. It does not read your source and it does not patch your code: the finding goes to your coding agent with the reproduction attached. The hosted workspace is invite-only — join the waitlist — and the free dependency audit in /install needs no account.

Questions this page answers

Why are Bolt apps prone to exposed keys?

Because the app is built to run entirely in the browser, so every key the UI needs ends up in the bundle unless it is proxied through a server.

Does hiding a page protect it?

No. The data request is separate from the render, and it goes out regardless.

Written by Offense Research, reviewed December 2, 2026. Correct something? Email imran@offenseresearch.com.