Sample

Sample rescue audit

A rescue audit of Larkfield Tutors

Larkfield Tutors is a made-up app, built to show what the audit contains.

Larkfield Tutors is a demonstration app that FluxForge built for this sample. Every person, child, booking and file in it is made up. It has no real users and is not published.

Several faults were planted on purpose, and the auditor was given the list. Each planted fault was confirmed by testing it. The SMS key in this app is fake, and so is the SMS service it names.

The app: a booking app for a small tutoring agency, with parent, tutor and admin roles, built with Lovable and run on Lovable Cloud.

Checked on 10 November 2026: the code, its database and file-storage rules, and the running app, as a signed-out visitor and with two test parent accounts.

Verdict

Rework, not rebuild.

The foundations are sound. The problems sit in a handful of access rules and screens that can be fixed where they are, and two features, payments and text reminders, are not real yet and have to be built properly.

The five most serious problems

  1. Critical Anyone on the internet, without signing in, can read every child's name, age, school and notes, including health notes such as "Allergic to peanuts."
  2. High Anyone who signs up can read the email address and name of every other user.
  3. High Anyone who signs up could download every child's lesson notes.
  4. High A parent can mark their own lessons as paid without paying anything.
  5. High Someone who uses a keyboard instead of a mouse gets stuck in the booking form's date and time boxes and cannot reach the Book button.

Fixed quote

US$4,125

To fix all 27 findings, add tests and checks, and retest. Fixed price. Anything not on this list is priced separately.

Every problem, ranked

27 findings: 1 Critical, 4 High, 12 Medium and 10 Low. 13 were planted on purpose. 14 are new: they were not on the list the auditor was given, and were found by the audit.

All 13 planted faults are confirmed, with two caveats:

  • F3 (lesson-notes storage): the rule is open, but no file exists yet, so there was nothing to download.
  • F6 (open booking-edit rule): this behaves more narrowly than intended. Postgres still applies the booking read rule, so Parent A could not change Parent B's booking. What the rule does allow is a parent rewriting their own bookings, which includes marking them paid (F4).
IDSeverityProblemWhat it lets someone doOriginPrice to repair
F1Critical Children's records are publicAnyone on the internet, without signing in, can read every child's name, age, school and notes, including health notes such as "Allergic to peanuts."PlantedUS$85
F2High Every account's email is visible to every accountAnyone who signs up can read the email address and name of every other user.PlantedUS$65
F3High Lesson notes are open to every accountAnyone who signs up could list and download every child's lesson-notes PDF.PlantedUS$85
F4High "Pay now" takes no paymentA parent can mark their own lessons as paid without paying anything.PlantedUS$850
F5High Keyboard trap in the booking date and time pickerSomeone using only a keyboard gets stuck between the date and time fields and cannot Tab on to the Book button.PlantedUS$45
F6Medium The booking-edit rule is open to every accountA parent can rewrite any detail of their own bookings (tutor, subject, date, paid) with no checks. The rule itself allows editing any booking; only the separate read rule holds it back.PlantedUS$130
F7Medium The admin page has no role checkAny signed-in user can open /admin and use its buttons. Only the database rules stop them seeing everyone's data.PlantedUS$85
F8Medium The parent dashboard shows other families' childrenEvery parent sees every family's children on their own "Your family" page and in the booking form's child list.NewUS$45
F9Medium Tutor email addresses are publicAnyone, signed out, can read every tutor's email address and account id.NewUS$130
F10Medium Roles come from the email addressWhoever first gets an account for the seeded admin address becomes admin. Anyone who gets an account with a seeded tutor or parent address takes over that person's records. Today only email confirmation stops this.New (design)US$340
F11Medium Sign-up and add-child fields have no labelsScreen-reader and voice-control users get no reliable field names, and the hint disappears as soon as anyone types.PlantedUS$65
F12Medium Booking form labels are not linked to their fieldsScreen readers announce the Subject, Tutor, Child, Date and Time fields without their names.NewUS$45
F13Medium Grey helper text is too faintPeople with low vision struggle to read helper text and subject tags across the app: 2.2–2.5:1 against the required 4.5:1.PlantedUS$45
F14Medium Focus jumps to the footerAfter confirming a booking, keyboard and screen-reader users land at the bottom of the page instead of back at the Book button.PlantedUS$20
F15Medium Errors are silent for screen readersSign-up and booking errors appear on screen but are never announced.PlantedUS$45
F16Medium Subject filters work only with a mouseKeyboard users cannot filter the tutor directory by subject.NewUS$65
F17Medium Known vulnerabilities in packages29 published advisories (1 critical, 14 high) affect the locked package versions. Most are in build tools; two are in code that runs for visitors.NewUS$130
F18Low SMS key in the browser code (the key is fake)Anyone can read the reminder-service key from the page code; with a real key they could send texts at the agency's expense. "Text me a reminder" also claims success without sending anything.PlantedUS$255
F19Low Tutor photos have no text alternativeScreen readers announce an unlabelled image on every tutor card.PlantedUS$20
F20Low Bookings are not checked on the serverBy calling the API directly, a parent can book a date in the past, a tutor for a subject they don't teach, or a slot that's already taken.NewUS$170
F21Low Success messages don't check the result"Payment received" and "Mark as paid" report success even when nothing was saved.NewUS$45
F22Low Database permissions are wider than the migration files saySigned-out visitors can query every table and call the helper functions. Only the row rules stop them, so one wrong rule exposes a table to everyone.NewUS$85
F23Low Upload checks happen only in the browserA tutor can store a file of any type or size in the lesson-notes folders by calling storage directly.NewUS$85
F24Low No browser security headersThe app sets no content-security policy and no rule against being framed, so another site could embed it to trick users. There is also no second line of defence if a script-injection bug ever appears.NewUS$85
F25Low Fonts load from GoogleEvery visitor's IP address and browser details go to Google on each page load.NewUS$65
F26Low Names default to the email addressAn account created without a name shows the first half of its email address as its name to tutors and admins.NewUS$20
F27Low The local development server listens on the whole networkWhile a developer runs the app locally, anyone on the same Wi-Fi can reach it.NewUS$20

A verdict for each part

The foundations are sound:

  • Database row rules (row-level security) are switched on for every table.
  • Most of those rules are written correctly.
  • No secret key reaches the browser.
  • The code type-checks cleanly.
Part of the appFindingsVerdict
Database access rulesF1, F2, F6, F9, F20, F22, F26Patch. The rules are close to right; restore or tighten them
File storage (lesson notes)F3, F23Patch
PaymentsF4, F21Rework. There is no payment system to fix; one has to be built
Sign-up and rolesF10Rework. Roles should be granted, not inferred from an email address
Admin areaF7Patch
Parent dashboardF8Patch
Text remindersF18Rework. Move sending to the server and connect a real provider
Accessibility (forms, picker, dialog, colours, images, filters)F5, F11–F16, F19Patch
Packages, hosting and toolingF17, F24, F25, F27Patch
Whole appRework, not rebuild

The findings, one by one

Each finding: where it is, what it lets someone do, the fix, and its verdict and price to repair. Its evidence is in the appendix.

F1 Children's records are public

Critical Origin: Planted. Confirmed by: Live, signed out.

Where

  • drizzle/migrations/0004_children_public_read_demo.sql:2-5, table public.children.
  • src/components/views/parent-view.tsx:42-49 reads it without a filter (see F8).

What it lets someone do

Anyone with the app's address can read every child's name, age, school and free-text notes, without an account. The publishable key that makes this possible is sent to every visitor's browser. Notes are written by parents and can hold health information: the seed data has "Allergic to peanuts."

Fix

Drop the demo rule and restore the original one, which already existed in 0000_larkfield_schema.sql:91-92: own children, admin, or a tutor with a booking for that child. Then run revoke select on public.children from anon;. Lovable manages this project's database schema, so ask Lovable to make the change.

Verdict: Patch. Price to repair: US$85.

See the evidence

F2 Every account's email is visible to every account

High Origin: Planted. Confirmed by: Live: Parent A read Parent B's.

Where

drizzle/migrations/0003_profiles_open_read_demo.sql:2-4, table public.profiles (id, email, full_name).

What it lets someone do

Anyone can sign up (sign-up is open; disable_signup: false) and then read the email address and name of every account, including staff and admins once those exist.

Fix

Restore the original rule, "own profile or admin" (0000_larkfield_schema.sql:79-80). Tutors already get parent contact details through the parents table, which is correctly restricted.

Verdict: Patch. Price to repair: US$65.

See the evidence

F3 Lesson notes are open to every account

High Origin: Planted. Confirmed by: Rule; no file existed to download.

Where

drizzle/migrations/0005_lesson_notes_open_read_demo.sql:2-5, storage bucket lesson-notes (private bucket, read rule open).

What it lets someone do

Any signed-in user can list every folder in the bucket and download any file in it. Folders are named after booking ids. The app's own screens stay tidy (the list of files shown to a parent comes from lesson_files, which is correctly limited to their bookings). But anyone calling storage directly could take every child's lesson notes.

Fix

Restore the booking-scoped read rule from 0001. Its check on public.bookings runs under the caller's own booking rules, so parents get their children's files, tutors get their lessons' files, and admins get everything.

Verdict: Patch. Price to repair: US$85 , including a retest with a tutor upload.

See the evidence

F4 "Pay now" takes no payment

High Origin: Planted. Confirmed by: Live: changed, then put back.

Where

  • src/components/views/parent-view.tsx:92-99 (mutation) and :241-243 (button).
  • Table public.bookings, column paid, made writable by F6.

What it lets someone do

A parent can mark any of their own lessons as paid. The browser simply sets paid = true. No payment provider is involved and the server does no check. The agency would see "Paid" for a lesson nobody paid for.

Fix

  1. Take payment through a provider's hosted checkout.
  2. Have a server function receive the provider's confirmation and set paid using the server-side key.
  3. Remove the browser update, and stop parents writing paid at all (see F6).

Verdict: Rework, as there is no payment system to repair. Price to repair: US$850.

See the evidence

F5 Keyboard trap in the booking date and time picker

High Origin: Planted. Confirmed by: Live.

Where

src/components/views/parent-view.tsx:189 (wrapper) and :264-278 (trapPickerFocus). WCAG 2.1.2 No Keyboard Trap (Level A).

What it lets someone do

A keyboard-only user who reaches the date field can't Tab past it. Tab and Shift+Tab only swap between date and time, and Escape is swallowed. So they can't reach the Book button by Tab and can't leave the form.

Fix

Delete the handler and let the browser's normal Tab order apply.

Verdict: Patch. Price to repair: US$45.

See the evidence

F6 The booking-edit rule is open to every account

Medium Origin: Planted. Confirmed by: Rule; live cross-family edits blocked.

Where

drizzle/migrations/0002_bookings_open_update_demo.sql:2-4, table public.bookings.

What it lets someone do

The rule lets any signed-in user change any column of any booking, with no limit on the result. In practice Postgres applies the booking read rule to any update with a filter, to both the old row and the new one (PostgreSQL docs, CREATE POLICY). So a parent can only edit bookings they can already see: their own. Within those, nothing is checked. They can:

  • mark the booking paid (F4)
  • move it to another tutor
  • change the subject to one that tutor doesn't teach
  • move the date into the past

Any future widening of the booking read rule would immediately let everyone edit everyone's bookings.

Fix

  1. Restore the admin-only update rule (0000_larkfield_schema.sql:102-103).
  2. If parents should be able to reschedule, add a narrow rule for their own unpaid future bookings, plus column-level grants so only lesson_date and lesson_time can change.

Verdict: Patch. Price to repair: US$130.

See the evidence

F7 The admin page has no role check

Medium Origin: Planted. Confirmed by: Live: both parents.

Where

  • src/routes/_authenticated/admin.tsx:4-19: there is no role check. The parent route src/routes/_authenticated/route.tsx:6-9 only checks that someone is signed in.
  • The menu link is hidden by src/components/site-header.tsx:35-39.

What it lets someone do

Any signed-in user who types /admin gets the admin screen with its Bookings, Users and Files tabs and "Mark as paid" buttons. What they see is still limited by the database rules: their own bookings, the tutors, and their own parent row. But the only protection left is the database. Hiding the link is not access control.

Fix

In the /admin route's beforeLoad, look up the caller's role and redirect anyone who isn't an admin. Keep the database rules as the real boundary.

Verdict: Patch. Price to repair: US$85.

See the evidence

F8 The parent dashboard shows other families' children

Medium Origin: New. Confirmed by: Live.

Where

src/components/views/parent-view.tsx:42-49 (query with no filter) and :184-187 (booking form "Child" list).

What it lets someone do

Every parent's "Your family" page lists every family's children, with schools and notes, and the booking form offers them as choices. A new parent with no children saw the eight seeded children. The booking form's default child was another family's (Archie Puddleton). A booking sent without changing it would be refused by the database and the parent would see a confusing error.

Fix

Filter by the parent's own id (.eq("parent_id", parent.data)). Fixing F1 also hides other families' children, but the query should not depend on that.

Verdict: Patch. Price to repair: US$45.

See the evidence

F9 Tutor email addresses are public

Medium Origin: New. Confirmed by: Live, signed out.

Where

  • drizzle/migrations/0000_larkfield_schema.sql:48 (grant select on public.tutors to anon, authenticated) and :84 (rule using (true)).
  • The public directory needs only five columns (src/routes/tutors.tsx:26).

What it lets someone do

Anyone, signed out, can read every tutor's email address and the id of their sign-in account, not just the directory fields.

Fix

Grant column-level read on id, full_name, bio, subjects, hourly_rate only. Give the admin screen its emails through an admin-only function or view.

Verdict: Patch. Price to repair: US$130.

See the evidence

F10 Roles come from the email address

Medium Origin: New (design). Confirmed by: Code and auth settings.

Where

drizzle/migrations/0000_larkfield_schema.sql:114-141 (handle_new_user, run after insert on auth.users); :120 hard-codes the admin address.

What it lets someone do

The first account created with the seeded admin address becomes admin. An account created with a seeded tutor's or parent's address becomes that person and inherits their records, including a seeded parent's children. The role is granted when the account row is created, before the email is confirmed.

Today two things stop an outsider:

  • Email confirmation is on (mailer_autoconfirm: false).
  • The .test addresses can't receive mail.

But anyone who creates the account on the Lovable Cloud Users page (which confirms automatically, as it did for the two test accounts) gets admin, or someone's records, at once. So does every sign-up, if confirmation is ever switched off.

Fix

  1. Remove the hard-coded admin address.
  2. Have an admin grant roles, for example through an invitation flow.
  3. Link a seeded record only after the email is confirmed.

Verdict: Rework. Price to repair: US$340.

See the evidence

F11 Sign-up and add-child fields have no labels

Medium Origin: Planted. Confirmed by: Live.

Where

  • src/routes/auth.tsx:90-102: "Parent sign up" fields fullName, email and password.
  • src/components/views/parent-view.tsx:141-145: "Add a child" fields name, age, school and notes.

WCAG 1.3.1 and 3.3.2 (Level A).

What it lets someone do

Fields are identified only by placeholder text. The hint vanishes once someone types, and assistive technology gets no proper label. The sign-in form, by contrast, keeps its labels.

Fix

Add a visible <Label htmlFor=…> for each field.

Verdict: Patch. Price to repair: US$65.

See the evidence

F12 Booking form labels are not linked to their fields

Medium Origin: New. Confirmed by: Live.

Where

src/components/views/parent-view.tsx:280-282 (Field renders <Label> with no htmlFor) and :173-192. WCAG 1.3.1 and 4.1.2 (Level A).

What it lets someone do

The words Subject, Tutor, Child, Date and Time are on screen, but none is attached to its control. Screen readers announce "combo box" or "text field" with no name.

Fix

Give each control an id and pass it to Field as htmlFor.

Verdict: Patch. Price to repair: US$45.

See the evidence

F13 Grey helper text is too faint

Medium Origin: Planted. Confirmed by: Measured.

Where

src/styles.css:92 (--muted-foreground: #9CA3AF, used across the app) and src/routes/tutors.tsx:80 (subject badges). WCAG 1.4.3 (Level AA).

What it lets someone do

Helper text, schools, empty-state messages and tutor subject tags are hard to read for people with low vision, or on a bright screen.

Fix

A darker token such as #4B5563, which measures 7.24, 7.56 and 6.53:1 on the same three backgrounds.

Verdict: Patch. Price to repair: US$45.

See the evidence

F14 Focus jumps to the footer when the booking dialog closes

Medium Origin: Planted. Confirmed by: Live.

Where

src/components/views/parent-view.tsx:203-207 (onCloseAutoFocus sends focus to #site-footer). WCAG 2.4.3 (Level A).

What it lets someone do

After "Confirm booking" or "Cancel", keyboard and screen-reader users are dropped at the end of the page and have to find their way back.

Fix

Remove the override so the dialog returns focus to the element that opened it.

Verdict: Patch. Price to repair: US$20.

See the evidence

F15 Errors are silent for screen readers

Medium Origin: Planted. Confirmed by: Live.

Where

src/routes/auth.tsx:103 (sign-up error) and src/components/views/parent-view.tsx:197 (booking error). WCAG 4.1.3 (Level AA).

What it lets someone do

A blind user who submits an incomplete form hears nothing and doesn't know why it failed.

Fix

Add role="alert" to both error messages.

Verdict: Patch. Price to repair: US$45.

See the evidence

F16 Subject filters work only with a mouse

Medium Origin: New. Confirmed by: Live.

Where

src/routes/tutors.tsx:57-64. The filters are Badge elements (<div>) with onClick. WCAG 2.1.1 (Level A).

What it lets someone do

Keyboard users can't reach or use "All subjects", "Maths" and the other filters in the public tutor directory.

Fix

Render them as <button type="button" aria-pressed=…>.

Verdict: Patch. Price to repair: US$65.

See the evidence

F17 Known vulnerabilities in packages

Medium Origin: New. Confirmed by: bun audit.

Where

bun.lock.

What it lets someone do

Most of the 29 advisories affect tools that run only on a developer's machine or during the build. Two affect code that reaches visitors:

  • seroval 1.6.8: used by the router to pass server-rendered data to the browser. 2 moderate advisories about code or script injection through unusual data types; this app doesn't pass such types.
  • zod 3.25.76: form validation in the browser. 1 high advisory about memory exhaustion on oversized collections; this app validates only small objects.

The single critical one, shell-quote via Lovable's development tools, runs only on a developer's machine.

Fix

Run bun audit fix (upgrades within the allowed ranges), update vite, vitest and the TanStack packages, rebuild, retest and re-run the audit.

Verdict: Patch. Price to repair: US$130.

See the evidence

F18 SMS key in the browser code

Low Origin: Planted. Confirmed by: Built bundle.

Where

src/lib/sms.ts:4-5 and :17-27; src/components/views/parent-view.tsx:101-105 and :244-254.

What it lets someone do

The reminder-service key LARKFIELD-SMS-KEY-demo-0001 is built into the code every visitor downloads. This key is fake, and the service it names (api.larkfield-sms.example) does not exist, which is why this is rated Low. With a real key this would be High: anyone could send texts at the agency's expense, or read its message history.

The "Text me a reminder" button also waits 0.6 seconds and shows "Reminder sent by text" without sending anything.

Fix

  1. Send reminders from a server function that reads the key from Lovable Secrets, and connect a real provider.
  2. Until then, remove the button or label it as a demo.

Verdict: Rework. Price to repair: US$255.

See the evidence

F19 Tutor photos have no text alternative

Low Origin: Planted. Confirmed by: Live.

Where

src/routes/tutors.tsx:72. WCAG 1.1.1 (Level A).

What it lets someone do

Screen readers announce an unnamed image on every tutor card. Some read out the long data: address instead.

Fix

alt="". The image only shows initials, and the tutor's name is next to it.

Verdict: Patch. Price to repair: US$20.

See the evidence

F20 Bookings are not checked on the server

Low Origin: New. Confirmed by: Code.

Where

  • drizzle/migrations/0000_larkfield_schema.sql:100-101: the insert rule checks only paid = false and that the child is the caller's.
  • The date check exists only in the browser, at src/components/views/parent-view.tsx:19-23.

What it lets someone do

By calling the API directly, a parent can create bookings in the past, with a tutor for a subject that tutor doesn't teach, with any made-up subject text, or on a slot another family has already booked.

Fix

Check in the database that the date is today or later and that the subject is one of the tutor's, and add a unique rule on tutor, date and time.

Verdict: Patch. Price to repair: US$170.

See the evidence

F21 Success messages don't check the result

Low Origin: New. Confirmed by: Code.

Where

src/components/views/parent-view.tsx:92-98 and src/components/views/admin-view.tsx:49-56.

What it lets someone do

An update that the database rules quietly block still returns "no error", so the screen shows "Payment received" or flips the badge although nothing was saved. With the admin-only payment rule restored, a parent pressing "Pay now" would be told they had paid.

Fix

Ask for the updated row back (.select()) and treat zero rows as a failure.

Verdict: Patch. Price to repair: US$45.

See the evidence

F22 Database permissions are wider than the migration files say

Low Origin: New. Confirmed by: Live, signed out.

Where

  • drizzle/migrations/0000_larkfield_schema.sql:47-52: the grants written in the migration.
  • :62-77: helper functions, which every caller may run by default.

What it lets someone do

The migrations grant signed-out visitors read access to tutors and (since 0004) children only. In practice they can query all seven tables and even send updates (tested on bookings). Every one of those calls is answered by the row rules alone. One mistaken rule written to public, or a table added without row rules, would be open to the whole internet.

Signed-out visitors can also call has_role(user_id, role). Combined with F2's list of account ids, anyone could find out which account is the admin.

Fix

Revoke table permissions the signed-out role doesn't need, and revoke execute on the helper functions from signed-out visitors.

Verdict: Patch. Price to repair: US$85.

See the evidence

F23 Upload checks happen only in the browser

Low Origin: New. Confirmed by: Code.

Where

  • src/components/views/tutor-view.tsx:25-33: PDF and 10 MB checks, browser only.
  • drizzle/migrations/0001_lesson_notes_storage.sql:3-4: the upload rule checks only the folder.
  • 0000_larkfield_schema.sql:109-110: lesson_files.file_path is not tied to the booking's folder.

What it lets someone do

A tutor (or anyone holding a tutor account) can store files of any type and size under their bookings by calling storage directly. They can also register a file record pointing at a path in another booking's folder.

Fix

  1. Set the bucket's size limit and allowed types (application/pdf, 10 MB).
  2. Require file_path to start with the booking id.

Verdict: Patch. Price to repair: US$85.

See the evidence

F24 No browser security headers

Low Origin: New. Confirmed by: Code; host not checked.

Where

src/start.ts and src/server.ts set no response headers. The build's .output/public/_headers sets only caching for /assets/*.

What it lets someone do

The app sends no content-security policy, no frame-ancestors or X-Frame-Options rule and no referrer policy. Another site could load it inside a frame to trick users into clicking (clickjacking). If a script-injection bug ever appeared, nothing would contain it. Session tokens are kept in browser storage (Supabase's default), so injected script could read them.

Fix

Add the headers in a server middleware and confirm them on the published host.

Verdict: Patch. Price to repair: US$85.

See the evidence

F25 Fonts load from Google

Low Origin: New. Confirmed by: Code.

Where

src/routes/__root.tsx:100-101.

What it lets someone do

Every page view sends the visitor's IP address, browser details and the referring page to Google's font servers. Google's font FAQ lists these. In 2022 a German court held that doing this without the visitor’s consent breached GDPR (LG München I, 3 O 17493/20).

Fix

Self-host Figtree and Fraunces. Both are under the SIL Open Font License.

Verdict: Patch. Price to repair: US$65.

See the evidence

F26 Names default to the email address

Low Origin: New. Confirmed by: Live: both test accounts.

Where

drizzle/migrations/0000_larkfield_schema.sql:119 and :135, which fall back to split_part(email,'@',1).

What it lets someone do

An account created without a name shows the part of its email before the @ as its name, in tutor screens, the admin page and the open profile list (F2). That is often enough to work out the full address.

Fix

Require a name at sign-up, or fall back to a neutral value.

Verdict: Patch. Price to repair: US$20.

See the evidence

F27 The local development server listens on the whole network

Low Origin: New. Confirmed by: Observed.

Where

Lovable's Vite settings, inherited through vite.config.ts and @lovable.dev/vite-tanstack-config.

What it lets someone do

vite dev printed two local-network addresses as well as localhost. Anyone on the same network can reach a developer's running copy, and the Vite development-server advisories in F17 apply to it.

Fix

Run local development with --host 127.0.0.1, or set it in the local config without changing the Lovable sandbox settings.

Verdict: Patch. Price to repair: US$20.

See the evidence

Personal data, and who can read it

All of it is made up in this demo. For a live agency, the children's records would be the most sensitive, because notes can hold health details.

DataTable or bucketWho should read itWho can read it today
Parent sign-in email and password hashauth.users (Supabase Auth)Nobody through the appOnly the server-side key. Correct
Account email and namepublic.profilesThe account itself and adminsEvery signed-in user (F2)
Parent name and emailpublic.parentsThe parent, admins, and tutors who teach their childrenAs intended. Live: Parent A saw only their own row
Child name, age, school, notes (may include health details)public.childrenThe parent, admins, and the child's tutorsEveryone, including signed-out visitors (F1)
Tutor name, bio, subjects, ratepublic.tutorsEveryone (public directory)Everyone. Intended
Tutor email and account idpublic.tutorsAdminsEveryone, including signed-out visitors (F9)
Bookings (child, tutor, subject, date, time, paid)public.bookingsThe parent, the tutor, adminsAs intended for reading. Editing is too wide (F6)
Rolespublic.user_rolesThe account itself and adminsAs intended
Lesson-notes file recordspublic.lesson_filesWhoever can see the bookingAs intended
Lesson-notes PDFsStorage bucket lesson-notes (private)Whoever can see the bookingEvery signed-in user (F3)
Visitor IP address, browser and page visitedSent to Google Fonts—Google (F25)
Everything aboveLovable Cloud and Cloudflare, as processors—The hosting providers, under their terms
BackupsCopies of the whole database, structure and data, kept by Lovable CloudProject editors (Lovable says anyone with edit access to the project can restore a backup)Lovable's documentation says it backs up the project's database once a day and keeps roughly 14 days of backups. It offers no point-in-time restore, and the backups do not include storage files, so the lesson-notes PDFs are not in them. The page states no plan conditions, so it does not say whether the Free plan differs. No restore was tested, because the audit had no database access. Source: Lovable docs, Back up, restore, and export your project's database, read 10 Nov 2026

What was checked and found correct

These checks passed and need no repair:

  • Access to other families' records is blocked. With F1–F3 aside, Parent A could not read Parent B's bookings, parent row, roles or lesson-file records. No change attempt on another family succeeded: seven attempts, all Content-Range: */0, and one 403 (live-test-log.md, sections 2 and 3).
  • Signed-out visitors are kept out of bookings, parents, profiles, roles, lesson files and the storage bucket. They are sent from /dashboard and /admin to the sign-in page.
  • No server secret is in the repository or the browser bundle. The repository's .env holds only the backend URL and the publishable key, which are public by design. The server-side key (SUPABASE_SERVICE_ROLE_KEY) is referenced only by Lovable's generated server file, and nothing in the app uses it.
  • Role, child-ownership and upload rules hold. There is no rule letting anyone write their own role. A parent can only add children to their own family. Only the booking's tutor can upload lesson notes. Signed links to lesson files expire after 60 seconds.
  • Supporting safeguards are in place. TanStack Start's CSRF protection is switched on for server functions. Error pages don't leak stack traces.

How hard it will be to maintain

Fairly easy to maintain once fixed. It is small and uses mainstream tools, but nothing tests the rules that matter most.

  • Size: about 1,250 lines of app code (routes, views, hooks, helpers) and 4,360 lines of generated interface components. The parent dashboard is one 280-line file that combines data loading, two forms, a dialog and the lesson list. It's still readable, but it's the first file to split.
  • Stack: TanStack Start and Router 1.168–1.170, React 19, Tailwind 4, shadcn/ui and Supabase JS 2. All are widely used. TanStack Start is the youngest piece and changes quickly, so router and server upgrades need care. The build uses a nitro beta (3.0.260603-beta).
  • Tests: one test, which checks only that / matches a page. No test covers the database rules, which is where every serious finding in this report sits. A small suite signing in as parent, tutor, admin and visitor would catch F1–F3, F6 and F9 automatically.
  • Checks: there is no CI (no .github folder), so lint, type check, tests and the audit run only when someone remembers. The type check passes. Lint fails with 441 errors, all prettier formatting: the formatter has never been run on the code Lovable wrote.
  • Dead weight:
    • Only 10 of the 46 interface components are used.
    • 32 runtime packages are used by nothing that runs, including recharts, react-hook-form, date-fns, cmdk, vaul and 22 Radix packages.
    • They don't reach visitors (the build drops them), but they add audit noise and upgrade work.
  • Two editors on one codebase: Lovable writes to the same branch and owns the database schema and generated files. Rule changes have to go through Lovable, not be added as hand-written migrations. Developers should pull before working and avoid rewriting pushed history.
  • Rules hard-coded in two places: some rules exist only in the browser (booking date check, upload type and size, admin link hiding), and the admin address is hard-coded in SQL. Both are easy to miss when changing the app; F10, F20 and F23 move them into the database.

The fixed quote

The quote covers each change, a check that it works, and asking Lovable to apply database changes, in the order below, which fixes the data exposures first. It excludes the payment and SMS providers' own fees and the time to open their accounts.

#RepairFindingsVerdictPrice (US$)
1Restore the children read rule; remove signed-out accessF1Patch85
2Restore the "own profile or admin" ruleF2Patch65
3Restore booking-scoped reads on lesson notes; retest with an uploadF3Patch85
4Hide tutor email and account id from the publicF9Patch130
5Restore admin-only booking edits; narrow rescheduling rule for parentsF6Patch130
6Real payments: hosted checkout, server confirmation, no browser writes to paidF4Rework850
7Granted roles instead of email-based roles; remove hard-coded admin addressF10Rework340
8Role check on /adminF7Patch85
9Parent dashboard shows only the parent's own childrenF8Patch45
10Revoke unneeded signed-out permissions and helper-function accessF22Patch85
11Server-side booking checks (date, subject, double booking)F20Patch170
12Upload limits and file-path checkF23Patch85
13Treat "nothing saved" as failure in payment buttonsF21Patch45
14Neutral default name instead of the email prefixF26Patch20
15Server-side reminders with the key in Secrets and a real providerF18Rework255
16Remove the keyboard trapF5Patch45
17Labels on sign-up and add-child fieldsF11Patch65
18Link booking form labels to their fieldsF12Patch45
19Darker helper-text colourF13Patch45
20Return focus to the Book buttonF14Patch20
21Announce errors (role="alert")F15Patch45
22Keyboard-operable subject filtersF16Patch65
23Empty alt on initials imagesF19Patch20
24Update vulnerable packages and re-auditF17Patch130
25Security headers; confirm on the published hostF24Patch85
26Self-host the fontsF25Patch65
27Local development server on 127.0.0.1F27Patch20
28Automated tests for the access rules (parent, tutor, admin, signed out)Maintainability—510
29CI running lint, type check, tests and audit on every pushMaintainability—130
30Run the formatter (441 lint errors)Maintainability—20
31Remove unused components and packagesMaintainability—85
32Retest everything and update this report——255
Total4,125

Subtotals

GroupRowsPrice (US$)
Security and data1–152,475
Accessibility16–23350
Packages and hosting24–27300
Maintainability28–31745
Retest32255

The payment and SMS reworks (rows 6 and 15) exclude the provider's own fees and the time to open provider accounts.

How the audit was done

App
Larkfield Tutors, a booking app for a small tutoring agency with parent, tutor and admin roles
Code audited
A private GitHub repository (name masked), branch main, commit b8e5539 (10 Nov 2026)
Backend
Lovable Cloud, which is built on Supabase: database, sign-in and file storage
Audit date
10 November 2026. Times are UTC
Method
Code and access-rule review; type check, lint, tests and the package manager's audit; live tests as a signed-out visitor and as two parent test accounts
Evidence
Request and response logs, screenshots and tool output, kept with the report. The evidence appendix quotes them
  1. What the auditor was told. The repository's notes (AGENTS.md) list the faults planted on purpose. The audit read that list, confirmed each fault from its rule or code and a live test, and then looked for anything else.
    • There were two exceptions to the live tests. For F3 and F6 the live test could show less than the rule; those findings say exactly what it showed. The SMS key (F18) was confirmed in the built browser code, not by sending a reminder.
    • The auditor also saw the owner's audit plan in the report folder (sample-audit-plan.md). It lists the same planted faults, plus one point to check: that roles are assigned by email address. AGENTS.md describes that as the intended design. It is reported as F10 and marked new because it was not planted, but the audit was pointed to it.
  2. Code and rule review. I read every file of app code in src/, all six database migrations in drizzle/migrations/ and the storage rules they define. The generated Lovable integration files were read but are not counted as app code.
  3. Build checks. I ran:
    • tsc --noEmit: passed.
    • eslint .: 441 formatting errors and 7 warnings, none in logic rules.
    • vitest run: 1 test, passed.
    • bun audit against bun.lock.

Output is in build-checks.txt and bun-audit.txt.

  1. Live tests. The app ran from the repository at commit b8e5539 on a local development server, connected to its real Lovable Cloud backend. Three kinds of caller:
    • Signed-out visitor: only the publishable key that every visitor's browser receives (signed-out-checks.txt).
    • Parent A and Parent B: two parent test accounts supplied by the owner. The owner signed in to them in the browser, so their email addresses and passwords appear nowhere in this report or its evidence.
    • Setup, through the app's own screens: each parent added one made-up child and booked one lesson.
    • How requests ran: Parent A then tried to read and change Parent B's records and those of the seeded families. Every request ran inside the signed-in page, so session tokens never left the browser. Test-account emails and names were masked before anything was recorded (live-test-log.md).
  2. Change checks. Each successful change altered one harmless field on a test account's own record and was put back straight away. The log records both steps. Blocked attempts were checked afterwards to confirm nothing had changed.

Limits:

  • No admin or tutor account exists, and creating one was outside the agreed scope. The admin and tutor paths were assessed from the code only.
  • The lesson-notes bucket holds no files, because nobody with a tutor account has ever uploaded one. F3 is therefore confirmed from its rule, not by downloading a file.
  • The live database rules were not read directly, as there was no database access. They come from the migration files, and the live behaviour matched them in every test.
  • The production host's response headers were not checked, because the app is not published.
  • An unfiltered "update every booking" request was not attempted, because it would have changed every booking in the system (see F6).

Evidence appendix

For every finding: what was looked at, and what was seen. The log and tool-output files named here are kept with the report, and this sample quotes them. The test accounts' names and email addresses were masked before anything was recorded.

Evidence for F1: Children's records are public

Looked at

  • drizzle/migrations/0004_children_public_read_demo.sql:2-5, table public.children.
  • src/components/views/parent-view.tsx:42-49 reads it without a filter (see F8).

Seen

grant select on public.children to anon;
create policy "INSECURE demo: anyone reads children" on public.children
  for select to anon, authenticated using (true);

Signed out, 17:51:19 (signed-out-checks.txt):

GET /rest/v1/children?select=*&order=name      (publishable key only, no session)
HTTP 200
[{"name":"Archie Puddleton","age":12,"school":"Larkfield Academy","notes":"Needs help with fractions.",…},
 {"name":"Barnaby Crumpetfield","age":10,"school":"Little Larkfield Primary","notes":"Allergic to peanuts.",…}, … 8 rows]

Signed in as Parent A at 18:44:23, the same table returned all 10 children (Content-Range: 0-9/10), including Parent B's test child.

Parent A's "Your family" page before adding a child. The Children list shows eight made-up children from other families, each with an age, a school and some with a note, such as "Allergic to peanuts."
Screenshot 1 (F1, F8): a new parent's dashboard lists eight other families' children.

Evidence for F2: Every account's email is visible to every account

Looked at

drizzle/migrations/0003_profiles_open_read_demo.sql:2-4, table public.profiles (id, email, full_name).

Seen

create policy "INSECURE demo: any signed-in user reads profiles" on public.profiles
  for select to authenticated using (true);

As Parent A, 18:44:23:

GET /rest/v1/profiles?select=id,email,full_name,created_at
HTTP 200
[{"id":"[Parent A's account id]","email":"<test-account email, redacted>","full_name":"<test-account name, redacted>"},
 {"id":"[Parent B's account id]","email":"<test-account email, redacted>","full_name":"<test-account name, redacted>"}]

The second row is Parent B's account. These two are the only accounts, which also shows that no admin or tutor has signed up yet (relevant to F10).

Evidence for F3: Lesson notes are open to every account

Looked at

drizzle/migrations/0005_lesson_notes_open_read_demo.sql:2-5, storage bucket lesson-notes (private bucket, read rule open).

Seen

CREATE POLICY "lesson notes read" ON storage.objects
  FOR SELECT TO authenticated
  USING (bucket_id = 'lesson-notes');

This replaced a rule that limited reads to bookings the caller can see (0001_lesson_notes_storage.sql:1-2).

Live, 18:44:25: POST /storage/v1/object/list/lesson-notes {"prefix":""} as Parent A returned 200 []. Signed out, the same call also returned 200 []. The bucket is empty because no tutor account exists to upload anything, so the exposure is confirmed by the rule but couldn't be shown with a real file. Signed-out visitors are correctly kept out: the rule applies only to signed-in callers.

Evidence for F4: "Pay now" takes no payment

Looked at

  • src/components/views/parent-view.tsx:92-99 (mutation) and :241-243 (button).
  • Table public.bookings, column paid, made writable by F6.

Seen

const { error } = await supabase.from("bookings").update({ paid: true }).eq("id", bookingId);
…
onSuccess: () => { toast.success("Payment received"); … }

Live, Parent A's own test booking (screenshot 2):

TimeStepResult
18:45:35Clicked Pay nowToast "Payment received", badge "Paid"; read back paid: true. No request went anywhere except the app's own backend
18:45:47Put back: PATCH /rest/v1/bookings?id=eq.[Parent A's booking id] {"paid":false}200, Content-Range: 0-0/1
18:45:48Read backpaid: false
The parent's Lessons list after pressing Pay now: the lesson shows a "Paid" badge and a "Payment received" message, although no payment provider was involved.
Screenshot 2 (F4): "Payment received" and "Paid", with no payment taken.

Evidence for F5: Keyboard trap in the booking date and time picker

Looked at

src/components/views/parent-view.tsx:189 (wrapper) and :264-278 (trapPickerFocus). WCAG 2.1.2 No Keyboard Trap (Level A).

Seen

if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); return; }
if (e.key !== "Tab") return;
… e.preventDefault();
inputs[(i + (e.shiftKey ? inputs.length - 1 : 1)) % inputs.length]?.focus();

Live, about 18:47: starting from the date field, focus went lesson_time (Tab), lesson_date (Tab), lesson_time (Tab), lesson_date (Shift+Tab), then stayed on lesson_date after Escape.

Evidence for F6: The booking-edit rule is open to every account

Looked at

drizzle/migrations/0002_bookings_open_update_demo.sql:2-4, table public.bookings.

Seen

create policy "INSECURE demo: any signed-in user updates bookings" on public.bookings
  for update to authenticated using (true) with check (true);

Live, all as Parent A, logged with Prefer: count=exact:

IdAttemptResult
C1, 18:44:56PATCH /rest/v1/bookings?id=eq.<Parent B's booking> {"lesson_time":"17:05"}200 [], Content-Range: */0. Parent B read it at 18:45:16: still 17:00:00
C4, 18:44:57PATCH /rest/v1/bookings?child_id=eq.<seeded child Archie Puddleton> {"lesson_time":"16:05"}200 [], */0
M1, 18:45:59Move Parent A's own booking onto Parent B's child403 42501 new row violates row-level security policy for table "bookings". Unchanged
P1, 18:45:35Change Parent A's own booking (paid)Allowed; put back at 18:45:47 (see F4)

Not tested: an update with no filter at all, which could in principle reach every booking. It would have changed every booking in the system, which is not a harmless check.

Evidence for F7: The admin page has no role check

Looked at

  • src/routes/_authenticated/admin.tsx:4-19: there is no role check. The parent route src/routes/_authenticated/route.tsx:6-9 only checks that someone is signed in.
  • The menu link is hidden by src/components/site-header.tsx:35-39.

Seen

  • Parent A, 18:46:32 (screenshot 3; Parent A's name masked. A screenshot of the Users tab is not shown here, because it carries email addresses):
    • Typing /admin opened "Admin" with "Bookings (1)", "Users (4)" and "Files (0)", and a "Mark as paid" button.
    • The Users tab lists the three tutors' email addresses.
  • Parent B, about 18:46: got the same page.
  • Signed out: /admin redirected to /auth.
The Admin page, opened by a parent account, with Bookings, Users and Files tabs and a "Mark as paid" button. The parent's name reads "[Parent A, masked]".
Screenshot 3 (F7): a parent on the admin page. The parent's name is masked.

Evidence for F8: The parent dashboard shows other families' children

Looked at

src/components/views/parent-view.tsx:42-49 (query with no filter) and :184-187 (booking form "Child" list).

Seen

const { data, error } = await supabase.from("children").select("*").order("name");

Live, 18:41: Parent A's dashboard before adding a child (screenshot 1). Later, Parent B's dashboard listed 10 children, including Parent A's test child.

Evidence for F9: Tutor email addresses are public

Looked at

  • drizzle/migrations/0000_larkfield_schema.sql:48 (grant select on public.tutors to anon, authenticated) and :84 (rule using (true)).
  • The public directory needs only five columns (src/routes/tutors.tsx:26).

Seen

Signed out, 17:51:19:

GET /rest/v1/tutors?select=*
HTTP 200
[{"full_name":"Dr Ferdinand Gigglesworth","email":"[removed]","user_id":null,…}, … 3 rows]

Evidence for F10: Roles come from the email address

Looked at

drizzle/migrations/0000_larkfield_schema.sql:114-141 (handle_new_user, run after insert on auth.users); :120 hard-codes the admin address.

Seen

if lower(new.email) = '[the seeded admin address]' then
  insert into public.user_roles (user_id, role) values (new.id, 'admin');
…
select id into t_id from public.tutors where lower(email) = lower(new.email) and user_id is null;
  • Auth settings, signed out, 17:51:19: "disable_signup":false,"mailer_autoconfirm":false.
  • Live: profiles holds only the two test accounts, so the admin address and all three tutor addresses are still unclaimed (tutors.user_id is null for all three).
  • Not exercised: creating more accounts was outside the agreed scope.

Evidence for F11: Sign-up and add-child fields have no labels

Looked at

  • src/routes/auth.tsx:90-102: "Parent sign up" fields fullName, email and password.
  • src/components/views/parent-view.tsx:141-145: "Add a child" fields name, age, school and notes.

WCAG 1.3.1 and 3.3.2 (Level A).

Seen

Live checks found 0 associated labels and no aria-label on all seven fields, about 17:55 and 18:47.

Evidence for F12: Booking form labels are not linked to their fields

Looked at

src/components/views/parent-view.tsx:280-282 (Field renders <Label> with no htmlFor) and :173-192. WCAG 1.3.1 and 4.1.2 (Level A).

Seen

Live, 18:47:44: all five controls have 0 associated labels (screenshot 4).

The Book a lesson form after pressing Book with its fields empty. The error "Please fill in every field" appears in plain red text, and the labels Subject, Tutor, Child, Date and Time sit above fields they are not attached to.
Screenshot 4 (F12, F15): the booking error and the unlinked labels.

Evidence for F13: Grey helper text is too faint

Looked at

src/styles.css:92 (--muted-foreground: #9CA3AF, used across the app) and src/routes/tutors.tsx:80 (subject badges). WCAG 1.4.3 (Level AA).

Seen

Computed live as #9ca3af. Contrast ratios: 2.43:1 on the page background (#fdfaf4), 2.54:1 on cards (#ffffff) and 2.19:1 on the subject badges (#f5eee0). The requirement is 4.5:1.

Evidence for F14: Focus jumps to the footer when the booking dialog closes

Looked at

src/components/views/parent-view.tsx:203-207 (onCloseAutoFocus sends focus to #site-footer). WCAG 2.4.3 (Level A).

Seen

Live, 18:42:38. After confirming Parent A's booking, document.activeElement was FOOTER#site-footer.

Evidence for F15: Errors are silent for screen readers

Looked at

src/routes/auth.tsx:103 (sign-up error) and src/components/views/parent-view.tsx:197 (booking error). WCAG 4.1.3 (Level AA).

Seen

Live, 18:47:44. "Please fill in every field" is a plain <p class="text-red-600"> with no role and no aria-live, and nothing above it in the page is a live region (screenshot 4).

Evidence for F16: Subject filters work only with a mouse

Looked at

src/routes/tutors.tsx:57-64. The filters are Badge elements (<div>) with onClick. WCAG 2.1.1 (Level A).

Seen

Live, about 17:55: 7 filter elements, all DIV, with no role and no tabindex.

Evidence for F17: Known vulnerabilities in packages

Looked at

bun.lock.

Seen

bun audit, run at about 17:50 (bun-audit.txt):

29 vulnerabilities (1 critical, 14 high, 13 moderate, 1 low)
  • Build and development only: shell-quote, launch-editor, brace-expansion, minimatch, js-yaml, esbuild, nanoid, source-map-js, vite (development server), @vitest/mocker.
  • Runtime: seroval, zod.

Evidence for F18: SMS key in the browser code

Looked at

src/lib/sms.ts:4-5 and :17-27; src/components/views/parent-view.tsx:101-105 and :244-254.

Seen

The key appears in the built bundle .output/public/assets/dashboard-BZl7c6pS.js:

var Bn=`LARKFIELD-SMS-KEY-demo-0001`,Vn=`https://api.larkfield-sms.example/v1/messages`;

Evidence for F19: Tutor photos have no text alternative

Looked at

src/routes/tutors.tsx:72. WCAG 1.1.1 (Level A).

Seen

Live, about 17:55: 3 images, hasAttribute('alt') false for each.

Evidence for F20: Bookings are not checked on the server

Looked at

  • drizzle/migrations/0000_larkfield_schema.sql:100-101: the insert rule checks only paid = false and that the child is the caller's.
  • The date check exists only in the browser, at src/components/views/parent-view.tsx:19-23.

Seen

Code review. Not exercised live, to keep test data to one booking per parent.

Evidence for F21: Success messages don't check the result

Looked at

src/components/views/parent-view.tsx:92-98 and src/components/views/admin-view.tsx:49-56.

Seen

Code review. Live test C1 showed that a blocked update returns 200 [] rather than an error.

Evidence for F22: Database permissions are wider than the migration files say

Looked at

  • drizzle/migrations/0000_larkfield_schema.sql:47-52: the grants written in the migration.
  • :62-77: helper functions, which every caller may run by default.

Seen

Signed out, 17:51:19:

  • GET /rest/v1/profiles returned 200 []. It is not refused as "permission denied", which means the table permission exists.
  • PATCH /rest/v1/bookings?… returned 200 [].
  • POST /rest/v1/rpc/has_role returned 200 false.
  • At 18:47:09, a signed-out same-value update on a real booking returned Content-Range: */0 (blocked by the row rule only).

Evidence for F23: Upload checks happen only in the browser

Looked at

  • src/components/views/tutor-view.tsx:25-33: PDF and 10 MB checks, browser only.
  • drizzle/migrations/0001_lesson_notes_storage.sql:3-4: the upload rule checks only the folder.
  • 0000_larkfield_schema.sql:109-110: lesson_files.file_path is not tied to the booking's folder.

Seen

Code review. No tutor account exists, so this was not exercised.

Evidence for F24: No browser security headers

Looked at

src/start.ts and src/server.ts set no response headers. The build's .output/public/_headers sets only caching for /assets/*.

Seen

Code review. The published host may add headers of its own; it was not checked because the app is not published.

Evidence for F25: Fonts load from Google

Looked at

src/routes/__root.tsx:100-101.

Seen

<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Figtree…&family=Fraunces…">.

Evidence for F26: Names default to the email address

Looked at

drizzle/migrations/0000_larkfield_schema.sql:119 and :135, which fall back to split_part(email,'@',1).

Seen

Live. Both test accounts' full_name values contained their email's local part, so the masking step had to remove them from every response.

Evidence for F27: The local development server listens on the whole network

Looked at

Lovable's Vite settings, inherited through vite.config.ts and @lovable.dev/vite-tanstack-config.

Seen

Development server output at 17:52.

Prepared by FluxForge with Claude Code, 10 November 2026. Sample report on a demonstration app; not an assessment of any real business.

Ready when you are

The free check needs your written permission and a 30-minute slot for the findings.