Summary
GitHub integration state stores authorization scopes independently of the currently granted GitHub token.
When permissions change, stored scope information can become outdated and no longer reflect actual capabilities.
Affected Files
- auth.ts
- connect.ts
- githubService.ts
Root Cause
Scope information is persisted separately from token validation.
Subsequent permission changes on GitHub are not always reflected in stored integration state.
This creates discrepancies between recorded and actual permissions.
Reproduction
- Connect a GitHub account.
- Modify granted scopes through GitHub.
- Return to DevCard.
- Inspect stored scope information.
- Compare against actual token permissions.
- Observe mismatches.
Expected Behavior
Stored scopes should accurately reflect current token permissions.
Actual Behavior
Scope information can become stale.
Why This Is Difficult To Detect
The issue appears only after permission changes occur outside the application.
Production Impact
- Incorrect capability checks
- Broken integrations
- Misleading UI state
- Authorization inconsistencies
Suggested Fix
Refresh scope metadata from the active token and validate permissions periodically.
Severity
Medium
Summary
GitHub integration state stores authorization scopes independently of the currently granted GitHub token.
When permissions change, stored scope information can become outdated and no longer reflect actual capabilities.
Affected Files
Root Cause
Scope information is persisted separately from token validation.
Subsequent permission changes on GitHub are not always reflected in stored integration state.
This creates discrepancies between recorded and actual permissions.
Reproduction
Expected Behavior
Stored scopes should accurately reflect current token permissions.
Actual Behavior
Scope information can become stale.
Why This Is Difficult To Detect
The issue appears only after permission changes occur outside the application.
Production Impact
Suggested Fix
Refresh scope metadata from the active token and validate permissions periodically.
Severity
Medium