Skip to content

Billing attribution: bind checkout and admin invoice subscriptions to WorkOS identity #6492

Closed

Description

@bokelley

Split from #3589.

Scope

Eliminate email-based entitlement attribution for both checkout and admin-invoice subscription paths.

Acceptance criteria

  • Server-created Stripe objects carry the initiating workos_user_id and organization id.
  • Webhooks resolve the subscription from those server-authored identifiers.
  • Customer email is advisory only and cannot redirect money or entitlement.
  • The admin-invoice path has the same binding guarantees as checkout.
  • Mismatches enter an auditable review state.
  • Adversarial tests prove an attacker-controlled email cannot attach a subscription to another organization.

Activity

  1. added this to the Evergreen milestone on Aug 13, 2026
  2. added
    enhancement
    admin-tool
    claude-triaged
    on Aug 13, 2026
  3. added
    triage:archive-review
    triage:outcome-missing
    on Sep 21, 2026
  4. bokelley commented on Sep 21, 2026

    @bokelley
    ContributorAuthor

    Maintainer triage — 2026-09-21

    Classification: Security/revenue bug

    Status: P0 — investigate and fix now

    Decision: Bind checkout and invoice attribution to the authenticated WorkOS identity; attacker-controlled email input must not redirect payment or entitlement.

    Next gate: Reproduce the mismatch, add a regression test, patch both checkout and webhook reconciliation, and have security/billing review the exact-head change.

  5. added
    priority:P0
    and removed
    triage:archive-review
    triage:outcome-missing
    on Sep 21, 2026
  6. modified the milestones: Evergreen, P0 Bugs on Sep 21, 2026
  7. added
    bug
    on Sep 21, 2026
  8. bokelley commented on Sep 21, 2026

    @bokelley
    ContributorAuthor

    Verification correction — 2026-09-21

    The initial P0 classification was based on the issue text; current-main source inspection shows the requested containment is already present:

    • checkout and invoice creation stamp workos_organization_id and workos_user_id;
    • org-scoped invoices without signer metadata are rejected;
    • public/Addie billing routes derive identity and email from the authenticated member context, not caller input;
    • email-matched Stripe customers owned by another org (or lacking org metadata) are skipped;
    • webhook resolution prefers the DB binding and server-authored Stripe metadata.

    Focused verification passed: stripe-client.test.ts, invoice-signer-metadata.test.ts, and billing-tools.test.ts — 172 tests passed. This includes caller-supplied email and cross-org email-match cases.

    Corrected recommendation: remove from P0 and mark verify-close. The security/revenue risk described here is already contained on current main; close as completed unless production evidence demonstrates a remaining path.

  9. added
    triage:verify-close
    and removed
    bug
    priority:P0
    on Sep 21, 2026
  10. modified the milestones: P0 Bugs, Evergreen on Sep 21, 2026
  11. bokelley commented on Sep 21, 2026

    @bokelley
    ContributorAuthor

    Current main already binds checkout and invoice flows to server-authored WorkOS identities, rejects unsigned org invoices, and passes the focused billing/cross-org email regression suite. Closing as implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    admin-toolclaude-triagedenhancementtriage:verify-close

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions