Repository navigation
fix(users): CSRF-protect browser auth requests; logout retires the browser session - #832
Merged
Merged
Conversation
…rowser session server-side Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…on cache and tests Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…utes need no session CSRF token Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…gout # Conflicts: # CHANGELOG.md
… CSRF test probes a shared-prop page Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Deploying simple-module-python with
|
| Latest commit: |
05a32cd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1ea649f7.simple-module-python.pages.dev |
| Branch Preview URL: | https://fix-s03-login-csrf-logout.simple-module-python.pages.dev |
This was referenced Nov 5, 2026
Merged
Merged
…gout # Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md # host/tests/test_migration_graph.py
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.
Hardening for the users module's local auth.
Browser auth requests
csrfTokenprop; the shared typed API client sends it asX-CSRF-Token.Origin,Referer,Sec-Fetch-Site).Sec-Fetch-Site: cross-siteis refused outright. Clients without browser headers (scripts, the e2e harness) keep working.base_urlcomparison, so deployments behind a TLS-terminating proxy are unaffected./api/users/auth/token*) set no cookie and touch no session, so they need no token: native clients and CORS-enabled cross-origin clients can use them.Logout
SESSION_ID_KEY). Logout records it inusers_revoked_session(migratione805a1b2c3d4, users trunk) until the session's own deadline, idempotently (ON CONFLICT DO NOTHING), and publishes an invalidation after commit. The provider refuses a retired id through the existing session-version cache, so a copied cookie stops working while other devices stay signed in.Behaviour changes are marked in CHANGELOG (Unreleased → Security) and
docs/modules/users.md.Pipeline: /optimize (1 commit), review passes (correctness + maintainability) with triage kept locally.
Local CI:
make lint✓ ·make test-py(8 workers) 7887 passed ✓ ·make test-js✓ ·make migrations-roundtrip-pg✓ (run on a fresh database).Note: migration
e805a1b2c3d4and the background-tasks perf PR'sc5d8e2f1a903both revisee731a1b2c3d4; whichever merges second re-points itsdown_revision.https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4