What Bookly told the reviewer, and what its code does.
Five questions from a customer's security review. For each one, Bookly's answer, what the code actually does, and the exact file and line that proves it.
Q1Can a customer only see their own data?
"Yes. Access to customer records is restricted so each customer can only see their own bookings."
The bookings table has no row-level security, so anyone with the public key every visitor's browser holds can read every booking. A database function also runs any SQL it is given, and the website calls it.
supabase/migrations/20260101000000_init.sql:1create table public.bookings (
supabase/migrations/20260101000000_init.sql:15create or replace function public.exec_sql(sql text) returns void language plpgsql security definer as $$ begin execute sql; end $$;
src/components/Admin.tsx:10return supabase.rpc('exec_sql', { sql })Q2Are passwords and keys kept out of the source code?
"Yes. All secrets are stored in environment variables, never in code."
An admin password and the Supabase admin key (which bypasses every database rule) are written into the code, and the file of secrets is committed to the repository.
src/components/Admin.tsx:3const ADMIN_PASSWORD = 'book…'
src/integrations/supabase/client.ts:5const SUPABASE_KEY = 'eyJ…'
.envcommitted to the repositoryQ3Are third-party API keys kept on the server?
"Yes. Calls to outside services are made from our backend."
The OpenAI key is read from a VITE_ setting, which is copied into the website itself, so every visitor can read it and spend on it.
src/components/Assistant.tsx:3const openai = new OpenAI({ apiKey: import.meta.env.VITE_OPENAI_API_KEY, dangerouslyAllowBrowser: true })
.env:3VITE_OPENAI_API_KEY=sk-p…Q4Are database queries protected against injection?
"Yes. All queries are parameterised."
A name a visitor types is pasted straight into the SQL text, so they can read or delete data they should not reach.
server/index.ts:9const rows = await db.query(`SELECT * FROM bookings WHERE customer_name = '${name}'`)Q5Does the server only accept requests from your own website?
"Yes. Cross-origin requests are restricted to our domain."
The server accepts requests from any website together with the visitor's login cookies, so another site can act as a logged-in user.
server/index.ts:5app.use(cors({ origin: true, credentials: true }))How this was produced
- The code side comes from Branch HQ's Health Check: fixed rules, no AI model, and the same code always gives the same result.
- Keys are never shown in full.
- Each check is recorded in a tamper-evident log, so the evidence can be shown later exactly as it was found.
- The code stays on our machine and is deleted when the work is done.
What this does not cover
- Settings changed only in the Supabase dashboard; worth confirming there.
- Business-logic flaws, and anything a manual penetration test would find.
- This is evidence for a security review. It is not a certification.
Bookly is a demo app we built with the mistakes AI app builders most often ship with. Its answers are examples of what companies typically write. Every key in it is fake.