Current view

Bug Finder

Sandpaper Engine

Bug Finder

Deterministic mock bug detection for unfinished AI-built apps. This version uses curated findings only, with scoped Cursor-style fix prompts.

Mock Data

Total bugs found

6

Deterministic mock findings

Critical bugs

2

Must fix before launch

High-risk bugs

4

Critical plus high severity

Filters

Filter mock bug findings by severity or bug type.

Bug list

6 findings shown.

CriticalStripe webhook without signature verification

Stripe webhook does not verify signature

app/api/stripe/webhooks/route.ts

Evidence

The webhook route receives Stripe events, but content preview does not show constructEvent, stripe-signature, or webhook secret verification.

Why it matters

Unsigned webhooks allow forged payment events, which can incorrectly activate subscriptions or corrupt billing state.

Recommended fix

Verify the raw request body with Stripe webhook signature verification before processing any event.

Success criteria

Webhook processing rejects unsigned events and only continues after signature verification succeeds.

CriticalSupabase service role used in client code

Supabase service role risk

components/admin/admin-data-panel.tsx

Evidence

Client-facing component preview references SUPABASE_SERVICE_ROLE_KEY while rendering admin data controls.

Why it matters

A service role key in client code bypasses RLS and can expose or mutate all project data.

Recommended fix

Remove service role references from client components and keep privileged Supabase usage in server-only code.

Success criteria

No client component, page, or NEXT_PUBLIC variable references the Supabase service role key.

HighAI route missing rate limit

AI chat route missing rate limit

app/api/ai/chat/route.ts

Evidence

AI chat route accepts user prompts and calls the provider, but no rate limit, throttle, or quota guard is shown.

Why it matters

Unbounded AI routes can create runaway API cost and degrade service for legitimate users.

Recommended fix

Add a small rate-limit guard or explicit placeholder that blocks repeated requests per user/session.

Success criteria

The AI chat route has a visible rate-limit decision before provider calls are made.

HighDuplicate route handlers

Duplicate API chat route

app/api/chat/route.ts and app/api/ai/chat/route.ts

Evidence

Two route handlers appear to own chat completion behavior with different request payload assumptions.

Why it matters

Duplicate handlers drift over time and make frontend calls unpredictable during launch QA.

Recommended fix

Choose one canonical chat API route and update references to use it; archive or remove the duplicate.

Success criteria

Only one chat route handles AI chat requests, and all UI calls point to the canonical route.

MediumMissing exports

Missing password reset route

app/(auth)

Evidence

Login and signup routes exist, but no reset-password, forgot-password, or password-reset route is present.

Why it matters

Users who forget credentials can become locked out, creating support burden immediately after launch.

Recommended fix

Add a minimal password reset route or a clear auth-provider handoff placeholder.

Success criteria

Login surfaces link to a password reset path and the path renders a launch-ready placeholder.

MediumEnv var referenced but not documented

NEXT_PUBLIC_APP_URL referenced but not listed in env example

lib/url.ts and .env.example

Evidence

App URL helper references NEXT_PUBLIC_APP_URL, but .env.example does not document the variable.

Why it matters

Missing app URL configuration breaks redirects, email links, webhook callbacks, and production previews.

Recommended fix

Add NEXT_PUBLIC_APP_URL to .env.example and note the expected Vercel production URL format.

Success criteria

.env.example lists NEXT_PUBLIC_APP_URL and no live production value is committed.