security: 5 vulnerability fixes (#20, #21, #22, #23, #25)#27
Conversation
- 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.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a05abbc310
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if row and row[1] == "!unusable" and normalized == admin_email: | ||
| raise ValueError("email_exists") |
There was a problem hiding this comment.
Restore one-time activation path for bootstrapped admin
create_user_with_account now returns email_exists when the bootstrapped admin row (password_hash == "!unusable") is used, but _ensure_admin_account still creates that unusable admin user on startup (src/opencmo/storage/_db.py). This removes the only self-service path that previously converted that row into a real login, so a fresh deployment cannot sign in as admin unless someone manually updates the database (the updated tests now do exactly that). Please add an explicit one-time admin-claim flow (or equivalent) before blocking this signup path.
Useful? React with 👍 / 👎.
Summary
Bundles the 5 valuable security fixes from Codex/Aardvark reviews. Tests updated to align with new (stricter) auth & credential behavior.
geo/askplatforms (cost-amplification fix)127.0.0.1by default (no LAN exposure)PR #24 is functionally redundant with #25; will close. PR #19 is the active feature branch and not included.
Test plan
pytest tests/test_publishers.py tests/test_trial_platform.py tests/test_email_verification.py tests/test_settings_multitenant.py tests/test_geo_ask.py— 69 passed locally