Skip to content

Fix session-bound CSRF protection and disable startup dialogs - #96

Open
youssefwalid245 wants to merge 1 commit into
Advanced-Computer-Lab-2026:mainfrom
youssefwalid245:fix/csrf-session-protection
Open

youssefwalid245 wants to merge 1 commit into
Advanced-Computer-Lab-2026:mainfrom
youssefwalid245:fix/csrf-session-protection

Conversation

@youssefwalid245

Copy link
Copy Markdown

Authenticated writes previously trusted the session cookie alone, allowing an attacker HTML form to overwrite a victim's recovery email. Add csrf-csrf protection to authenticated writes and an authenticated token endpoint; the client echoes the token header while keeping login and registration exempt.

Bind CSRF signatures to unique login sessions using a random JWT identifier. Disable the recurring native dialogs and automatic folder-open setup tasks, document their source in SECURITY_REVIEW.md, and include the generated test configuration and CI workflow. Pin the temporary test database to MongoDB 7.0.14 because MongoDB 8.2.6 crashes on this Mac with a missing libc++ symbol.

Validation:

  • npm test -- --runInBand: 2 suites, 8 tests passed.
  • npm run build --workspace client: passed.
  • Automated forged form submission from localhost:1337 returns 403 and leaves the recovery email unchanged.
  • A previous login session's CSRF token is rejected; fetching a fresh token restores legitimate writes.

The interactive browser walkthrough in Flow.md has not yet been performed.

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