Skip to content

[Codex Security] Best-effort membership cache invalidation allows access after project removal - #501

Merged
anandtopu merged 2 commits into
mainfrom
codex-security/arp_4c132ebfe9b508cd2fc47cea61b13acc
Nov 28, 2026
Merged

anandtopu merged 2 commits into
mainfrom
codex-security/arp_4c132ebfe9b508cd2fc47cea61b13acc

Conversation

@anandtopu

Copy link
Copy Markdown
Contributor

The patch makes PostgreSQL the project-membership authority and prevents stale Redis state from preserving revoked report access.

  • get_accessible_project_ids now queries current ProjectMember rows for ordinary user scopes and never reads or fills Redis.
  • resolve_project_scope therefore rejects a removed member before report data is queried, closing the five-minute post-revocation disclosure path.
  • ADMIN access, project-bound API-key confinement, role floors, current-member reads, and best-effort legacy key cleanup remain intact.
  • The documentation and focused PostgreSQL integration coverage describe the rolling-deployment requirement and the member-revocation report contract.

Static Verification Checks

  • PostgreSQL authority closes race (Passed) — backend/app/core/deps.py:get_accessible_project_ids queries current membership rows and never reads Redis, closing the stale-cache authorization path.

  • Report revocation regression (Passed) — test_all_projects_member_scope_postgres.py asserts allowed report access, committed membership removal denial, and retained administrator access.

  • Role and key compatibility (Passed) — get_accessible_project_ids preserves administrator, project-bound key, and role-floor branches, establishing legitimate authorization behavior remains intact.

  • Legacy cleanup cannot authorize (Passed) — invalidate_membership_cache only deletes residual Redis keys while authorization callers consume PostgreSQL results, preventing cleanup from granting access.

  • Deployment guidance reflects boundary (Passed) — architecture/SECURITY.md and user-guide/compliance.md require every read replica upgraded before relying on PostgreSQL authorization.

  • Finding: acf_fc1727b012ab0f5cd1a4e0d6480f3642

  • Patch: arp_4c132ebfe9b508cd2fc47cea61b13acc

  • Base commit: 955292f065607646b431f08d6c2441c485a29b69

  • Patch SHA-256: d5c186aa9fa7cad1b5be3ab9242413b0c3770ab76174f1291edbe90a2584cd50

Signed-off-by: Anand Topu <56218058+anandtopu@users.noreply.github.com>
@anandtopu
anandtopu force-pushed the codex-security/arp_4c132ebfe9b508cd2fc47cea61b13acc branch from cba4c93 to dbab583 Compare November 28, 2026 06:59
@anandtopu
anandtopu marked this pull request as ready for review November 28, 2026 07:08
@anandtopu
anandtopu enabled auto-merge November 28, 2026 07:16
Signed-off-by: Anand Topu <56218058+anandtopu@users.noreply.github.com>
@anandtopu
anandtopu force-pushed the codex-security/arp_4c132ebfe9b508cd2fc47cea61b13acc branch from dbab583 to e03ae70 Compare November 28, 2026 07:18
@anandtopu
anandtopu merged commit 89896d7 into main Nov 28, 2026
41 checks passed
@anandtopu
anandtopu deleted the codex-security/arp_4c132ebfe9b508cd2fc47cea61b13acc branch November 28, 2026 07:40
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