Repository navigation
Add CSRF protection (csrf-csrf) and rate limiting (express-rate-limit) - #76
Open
youssefmashaly wants to merge 1 commit into
Open
youssefmashaly wants to merge 1 commit into
youssefmashaly wants to merge 1 commit into
Conversation
youssefmashaly
commented
Nov 12, 2026
- 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>
Author
|
Fixes CSRF with csrf-csrf and DoS with express-rate-limit. All 6 tests pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.