Skip to content

fix(security): restrict billing portal access - #6116

Draft
bokelley wants to merge 2 commits into
mainfrom
security-wave-13-billing-portal-role
Draft

fix(security): restrict billing portal access#6116
bokelley wants to merge 2 commits into
mainfrom
security-wave-13-billing-portal-role

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • require an active exact-organization owner or admin role before issuing Stripe Customer Portal sessions
  • live-recheck WorkOS authorization at direct, Addie, invoice-lock, and checkout post-discovery boundaries to close cached-role and TOCTOU gaps
  • preserve ordinary-member invoice and checkout intake while returning active-subscription responses without privileged portal URLs

Security impact

Stripe Customer Portal sessions can change payment methods, subscriptions, and cancellation state. Previously any organization member could obtain one directly or through Addie, invoice, and checkout paths. This change centralizes billing-manager authorization, fails closed for inactive/mismatched/revoked memberships, and keeps invite flows portal-free.

Validation

  • 4,947 server unit tests passed; 30 skipped
  • 49 focused billing authorization tests passed
  • TypeScript build passed
  • Semgrep: 0 findings across changed files
  • git diff --check passed
  • changeset protocol-scope check passed
  • independent security review: CLEAN
  • independent testing review: CLEAN

Database-backed billing portal assertions are included and will run in CI; the local environment did not provide DATABASE_URL.

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