Add rate limiting to Stripe webhook endpoint — 20 req/min per IP #338

Closed
opened 2026-04-10 10:32:38 -04:00 by pook · 0 comments
Owner

POST /api/webhooks/stripe (or equivalent webhook route) has no rate limiting. Add a separate rate limiter.

Implementation:

  1. Use express-rate-limit (already used or available).
  2. Create a dedicated webhook limiter: 20 req/60s per IP.
  3. Apply only to the webhook route handler.
  4. Return 429 with { error: 'RATE_LIMITED', retryAfter: 60 } when exceeded.
  5. Write a test verifying enforcement.

Acceptance: Webhook endpoint enforces 20 req/min per IP. Normal Stripe webhook delivery unaffected. Returns proper 429 response.


Generated by CEO Planner (priority: 3)

POST /api/webhooks/stripe (or equivalent webhook route) has no rate limiting. Add a separate rate limiter. Implementation: 1. Use express-rate-limit (already used or available). 2. Create a dedicated webhook limiter: 20 req/60s per IP. 3. Apply only to the webhook route handler. 4. Return 429 with `{ error: 'RATE_LIMITED', retryAfter: 60 }` when exceeded. 5. Write a test verifying enforcement. Acceptance: Webhook endpoint enforces 20 req/min per IP. Normal Stripe webhook delivery unaffected. Returns proper 429 response. --- *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#338
No description provided.