Expired Discord link codes and OAuth states are never deleted (discord_link_codes, discord_oauth_states) #266

Open
opened 2026-10-05 02:59:38 -04:00 by logan · 0 comments
Owner

Low priority, found reviewing PR #260 (#225 S6).

Neither discord_link_codes/{CODE} (/drb link, discord_guild_link.py) nor the new discord_oauth_states/{sha256(nonce)} (discord_oauth.py) is ever deleted: used and expired docs stay forever. They hold no secret (the OAuth nonce is stored hashed), only org_id/uid/token_id/node_id/return_to, and growth is rate-limited (5 starts per 10 min per uid), so this is housekeeping, not a leak.

Fix options: a Firestore TTL policy on expires_at (needs the field as a Timestamp, it is an ISO string today), or delete expired docs opportunistically when a new code/state is minted.

Low priority, found reviewing PR #260 (#225 S6). Neither `discord_link_codes/{CODE}` (`/drb link`, discord_guild_link.py) nor the new `discord_oauth_states/{sha256(nonce)}` (discord_oauth.py) is ever deleted: used and expired docs stay forever. They hold no secret (the OAuth nonce is stored hashed), only org_id/uid/token_id/node_id/return_to, and growth is rate-limited (5 starts per 10 min per uid), so this is housekeeping, not a leak. Fix options: a Firestore TTL policy on `expires_at` (needs the field as a Timestamp, it is an ISO string today), or delete expired docs opportunistically when a new code/state is minted.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: logan/server-26#266