Skip to content

Add CSRF protection (csrf-csrf) and rate limiting (express-rate-limit) - #76

Open
youssefmashaly wants to merge 1 commit into
Advanced-Computer-Lab-2026:mainfrom
youssefmashaly:fix/csrf-and-rate-limit
Open

youssefmashaly wants to merge 1 commit into
Advanced-Computer-Lab-2026:mainfrom
youssefmashaly:fix/csrf-and-rate-limit

Conversation

@youssefmashaly

Copy link
Copy Markdown
  • Server: per-session double-submit CSRF token via csrf-csrf; GET /api/csrf-token issues it, all state-changing requests require x-csrf-token (login/register exempt).
  • Server: rate-limit maintenance routes (30 req/min) -> 429 on flood.
  • Client: axios interceptor fetches and attaches the CSRF token on writes.
  • Add Jest/Babel config, test suite and CI workflow.

- Server: per-session double-submit CSRF token via csrf-csrf; GET /api/csrf-token
  issues it, all state-changing requests require x-csrf-token (login/register exempt).
- Server: rate-limit maintenance routes (30 req/min) -> 429 on flood.
- Client: axios interceptor fetches and attaches the CSRF token on writes.
- Add Jest/Babel config, test suite and CI workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@youssefmashaly

Copy link
Copy Markdown
Author

Fixes CSRF with csrf-csrf and DoS with express-rate-limit. All 6 tests pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant