Skip to content

Device tokens: reduce OAuth credential retention and membership-check amplification #1200

Description

@steipete

Follow-up from the security review of #1199 (device pairing / read-only device tokens):

Each device-token record currently stores the owner's sealed GitHub OAuth credential for the full 90-day token lifetime, and every device-token request spends two uncached GitHub API calls for fail-closed membership revalidation. Three consequences worth improving:

  • Credential at rest: the sealed OAuth credential's blast radius lives as long as the device token, not as long as the OAuth session.
  • Rate-limit amplification: a busy device (or several) can burn meaningful GitHub API quota; membership checks could be cached briefly (e.g. 60s, still fail-closed on error) without materially weakening revocation latency.
  • Silent early death: the device token nominally lasts 90 days but stops working whenever the stored OAuth grant expires or is revoked, which will read as a mystery failure on the device. Either surface a distinct error (pairing_reauth_required) or document the coupling.

None of this blocks the merged v1; it should be addressed before the iOS client (#778) ships broadly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions