Add CSRF token protection middleware to state-changing API endpoints #473
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#473
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Same pattern as contractpilot — the app uses cookies for JWT tokens. Add double-submit cookie CSRF middleware: (1) generate random CSRF token, (2) set as
SameSite=Strict; Secure; HttpOnlycookie, (3) require matchingX-CSRF-Tokenheader on POST/PUT/DELETE/PATCH, (4) reject with 403 if missing. Exclude /api/billing/webhook endpoints (Stripe uses signature validation). Apply after auth middleware. Acceptance: POST without CSRF returns 403, with token succeeds, webhook endpoints unaffected.Generated by CEO Planner (priority: 2)