Add CSRF protection to forms #1
Labels
No labels
blocked:gate-fetch
blocked:lint-failed
blocked:needs-decision
bug
feature-request
in-progress
needs-decompose
ops-task
quickfix
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/itchbox#1
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?
The MVP has no form protection against CSRF attacks. All forms (upload, delete) lack CSRF tokens.
Expected behavior:
Suggested approach:
starlette-csrfmiddlewareThis issue is still outstanding. The MVP currently has no CSRF protection on forms.
Work completed so far:
Remaining: CSRF tokens need to be added to all POST forms.
This is a lower priority than authentication - for now, deploy behind a reverse proxy with auth.
Auto-triage: needs decompose
Marked
triage-approved+needs-decompose. decompose-executor will pick this up and break it into implementable sub-issues.Auto-triage: needs decompose
Marked
triage-approved+needs-decompose. decompose-executor will pick this up and break it into implementable sub-issues.Auto-triage: needs decompose
Marked
triage-approved+needs-decompose. decompose-executor will pick this up and break it into implementable sub-issues.Auto-triage: needs decompose
Marked
triage-approved+needs-decompose. decompose-executor will pick this up and break it into implementable sub-issues.Bughunt follow-up: issue was closed with app/csrf.py committed but never wired in — no middleware registration, no POST validation, no hidden form fields, no CSRF tests. The protection was non-functional (verified: /upload set no cookie and accepted tokenless POSTs).
Landed the missing wiring in
bda4c59(fix: wire CSRF protection):Docs for ITCHBOX_CSRF_SECRET / ITCHBOX_CSRF_SECURE_COOKIE added in
25d1786.Also fixed while hunting: home() pagination clamps ?page=0/negative to page 1 (was slicing from the wrong end), and update_game now rejects traversal entrypoints (../../etc/passwd) instead of rendering them into the iframe src.