What is wrong
The payment webhook trusts the request body without checking the signature.
Impact: Anyone could grant themselves a paid plan for free.
Evidence (fixture)
src/routes/api/webhook.ts:9–20 · commit a3f9c21
const event = await req.json() // fixture
Expected
Unsigned requests are rejected.Observed
Handler upgrades plans from any JSON payload.Recommended fix
Verify the signature header before processing.
Repair prompt for your AI builder
In api/webhook.ts verify the payment provider's signature header with the webhook secret before handling any event; reject invalid requests with 400.
Paste it into Lovable, Claude Code, Cursor or Codex.