[Codex Security] Working demo seeds expose a public admin login in managed tenants

Draft
KN
14h ago
+257-21

Managed provisioning now separates starter content from published demo credentials.

  • The managed callback seeds connector, alert, and case data without creating or moving the demo user.
  • The credential helper refuses noncanonical tenants before database access, closing equivalent internal caller paths.
  • A guarded migration revokes and neutralizes previously seeded non-demo administrators while preserving the canonical demo tenant.
  • Invite-pending customer administration and populated managed dashboards remain supported.

Static Verification Checks

  • Managed credential separation (Passed) — provisioner._default_demo_seeder calls only data seeders, establishing managed provisioning cannot create or relocate published credentials.

  • Credential helper isolation (Passed) — seed_demo._ensure_user rejects noncanonical tenant IDs before database access, establishing alternate callers cannot relocate the wildcard user.

  • Existing account retirement (Passed) — 161_retire_managed_demo_admin.sql deactivates and revokes the exact non-demo principal, establishing deployed vulnerable accounts lose access.

  • Legitimate provisioning preserved (Passed) — test_managed_seed_has_no_published_demo_login asserts pending administration, 30 alerts, and 28 cases, establishing legitimate onboarding remains intact.

  • Regression control coverage (Passed) — auth-escalation-live.yml restores both vulnerable layers and requires failure, establishing coverage detects the original provisioning-to-login path.

  • Static scope verification (Passed) — Final diff inspection replaced runtime commands, establishing source-level attack-path closure without runtime execution.

  • Finding: acf_2411ae535766903574dd203e0f3a41f5

  • Patch: arp_19b3a81d397e890f754d44ce855efb89

  • Base commit: 505d29ea7bb8b8404972fc32577609c43ce98724

  • Patch SHA-256: f8ca5e40f1f89f3b6730b261205028cae8c73c4267a8ecab5b8893854d9636f7

Summary by Sourcery

Separate managed starter-data provisioning from published demo credentials and retire vulnerable seeded administrators.

Bug Fixes:

  • Prevent managed tenant provisioning from creating or relocating the published demo administrator and close equivalent credential-seeding paths.
  • Retire previously seeded non-demo demo administrators by revoking access, neutralizing credentials, and invalidating sessions while preserving the canonical demo tenant.

Enhancements:

  • Preserve invite-pending tenant administration and managed starter alerts and cases during provisioning.

CI:

  • Add regression controls that fail if managed provisioning is reconnected to the published demo credential path.

Tests:

  • Add coverage for noncanonical tenant credential rejection, legacy administrator retirement, and end-to-end managed provisioning without demo login access.

Summary by cubic

Managed provisioning used to call the demo seeder's user helper, creating a deterministic admin with published credentials in every new tenant. Managed tenants now receive only starter alerts, cases, and connectors — the helper refuses non-demo tenants before touching the database, and a migration retires demo admins already seeded into managed tenants.

  • Migration - 161_retire_managed_demo_admin.sql targets users by id, email, and admin role in any tenant other than the canonical demo tenant, deactivating the account, downgrading it to viewer, and revoking its sessions; deliberately re-seeding the demo tenant still restores the full identity.