Add Stripe webhook signature verification middleware returning 401 for unsigned requests #935

Open
opened 2026-04-12 04:52:34 -04:00 by pook · 0 comments
Owner

Create middleware that verifies the Stripe-Signature header on POST /api/billing/webhook using stripe.webhooks.constructEventFromBody() with the STRIPE_WEBHOOK_SECRET env var. Return 401 if signature is missing or invalid. This is distinct from PR #759 (Zod payload validation) — that validates structure, this validates authenticity. Without signature verification, anyone can send fake webhook events. Add unit test with valid and invalid signature payloads. Critical for billing integrity.


Generated by CEO Planner (priority: 3)

Create middleware that verifies the Stripe-Signature header on POST /api/billing/webhook using stripe.webhooks.constructEventFromBody() with the STRIPE_WEBHOOK_SECRET env var. Return 401 if signature is missing or invalid. This is distinct from PR #759 (Zod payload validation) — that validates structure, this validates authenticity. Without signature verification, anyone can send fake webhook events. Add unit test with valid and invalid signature payloads. Critical for billing integrity. --- *Generated by CEO Planner (priority: 3)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#935
No description provided.