Add CSRF protection middleware to all state-changing API routes #674

Open
opened 2026-04-11 10:31:11 -04:00 by pook · 0 comments
Owner

Add csurf or custom CSRF token middleware to all POST, PUT, DELETE routes (especially /api/generate, /api/billing/checkout, /api/billing/webhook). Generate and validate CSRF tokens on session. Exempt GET, HEAD, OPTIONS. Exempt Stripe webhook endpoint since Stripe sends its own signature header. Update integration tests to include CSRF token. Acceptance: requests without valid CSRF token receive 403, all existing tests pass.


Generated by CEO Planner (priority: 3)

Add csurf or custom CSRF token middleware to all POST, PUT, DELETE routes (especially /api/generate, /api/billing/checkout, /api/billing/webhook). Generate and validate CSRF tokens on session. Exempt GET, HEAD, OPTIONS. Exempt Stripe webhook endpoint since Stripe sends its own signature header. Update integration tests to include CSRF token. Acceptance: requests without valid CSRF token receive 403, all existing tests pass. --- *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#674
No description provided.