HIGHsrc/app/api/admin/route.ts
API route missing authentication
A private admin endpoint accepts requests without checking who is calling it. Anyone who finds the route could trigger protected actions.
Add a server-side auth check before running the handler. Return 401 before reading or changing data.
HIGHsrc/lib/ai/generate.ts
AI calls need a monthly cap
The app can call an AI provider from a user-facing path. Without a usage cap, one busy account could create surprise provider spend.
Tie prompt generation to plan limits, record usage per user, and stop calls once the monthly cap is reached.
MEDIUMsrc/app/api/webhooks/stripe/route.ts
Stripe webhook signature check missing
The webhook reads payment events without verifying that Stripe sent them. Fake events could mark unpaid accounts as active.
Use the raw request body and stripe.webhooks.constructEvent with your webhook signing secret.
MEDIUMsrc/instrumentation.ts
Launch checklist is missing observability
The repo has no clear production error tracking or uptime monitoring. Failures could reach users before you know about them.
Add error tracking, uptime checks, and alerts for failed jobs, payment webhooks, and scan failures.