fix: prevent session issuance on already-verified verify-email calls#20
Closed
study8677 wants to merge 1 commit into
Closed
fix: prevent session issuance on already-verified verify-email calls#20study8677 wants to merge 1 commit into
study8677 wants to merge 1 commit into
Conversation
2 tasks
study8677
added a commit
that referenced
this pull request
May 21, 2026
* fix: validate and dedupe geo ask platforms * fix: bind docker compose port to localhost by default * fix: prevent verify-email auth bypass for verified users * fix: fail closed for account-scoped publish credentials * fix: prevent admin privilege escalation via signup * test: update admin/publisher tests for security fixes - test_publishers.py: replace env vars with llm.set_request_keys() since publish credentials no longer fall back to os.environ (account-scoped). - test_trial_platform.py: add _seed_admin() helper that activates the bootstrapped !unusable admin row directly, since signup can no longer claim that row to prevent admin privilege escalation. * test: fix ruff I001 import order
Owner
Author
|
Incorporated via #27 → main. |
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.
Motivation
POST /api/v1/auth/verify-emailhandler could issue a valid session for any already-verifieduser_idwithout checking a code or credentials, enabling account takeover when users were backfilled as verified.Description
src/opencmo/web/app.pyso that an already-verified user returns{"ok": false, "error": "already_verified"}with status400instead of calling_json_with_sessionand setting a session cookie.tests/test_email_verification.py::test_verify_email_already_verified_requires_login_flowthat confirms a first valid verify signs in and a second unauthenticated verify for the same user returnsalready_verifiedand does not setopencmo_session.Testing
pytest tests/test_email_verification.py -qwhich initially failed collection in this environment due toModuleNotFoundError: No module named 'opencmo'whenPYTHONPATHwas not set.PYTHONPATH=src pytest tests/test_email_verification.py -q; collection succeeded but the local environment skips optional test setup so the suite reported skipped tests and no functional failures (collection validated the new regression test).Codex Task