Skip to content

Commit f3e897c

Browse files
committed
docs: replace removed "10 failed attempts" cap with per-IP rate limit
The per-code failed-attempt counter was removed (it could never fire: the counter was keyed by the code hash, which a wrong guess cannot match). Update the bridge-code descriptions in flows, architecture, and deployment to state that code guessing is rate-limited per source IP instead.
1 parent 3d2a276 commit f3e897c

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

docs/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ Re-submitting an existing submission ID succeeds only when the project, contribu
340340
- **Bridge codes**: contributor sign-in and device-link codes share one
341341
single-use bridge table (`private.session_link_codes`): 8 characters from
342342
an unambiguous alphabet, stored only as SHA-256 hashes, atomic consume,
343-
short TTLs, and a failed-attempt cap.
343+
and short TTLs. Code guessing is rate-limited per source IP.
344344
- **Mint throttles**: self-service sign-in-code requests are throttled per
345345
user (3 per 20 minutes) and per IP (20 per hour); administrator minting is
346346
authenticated and written to `audit_events`.

docs/deployment.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,12 @@ project is linked. The production project currently has these applied:
168168
screen can never create accounts; only administrator invitations do.
169169
- **Bridge codes**: contributor sign-in and device-link codes share one
170170
bridge table: 8 characters from an unambiguous alphabet (32⁸), single-use
171-
with an atomic consume, stored only as SHA-256 hashes, and capped at 10
172-
failed attempts. Sign-in codes expire after 20 minutes and are throttled
173-
(3 per user per 20 minutes on self-service; the anonymous request path is
174-
additionally capped per IP at 20 per hour). Device-link codes expire after
175-
5 minutes.
171+
with an atomic consume, and stored only as SHA-256 hashes. Sign-in codes
172+
expire after 20 minutes and are throttled (3 per user per 20 minutes on
173+
self-service; the anonymous request path is additionally capped per IP at
174+
20 per hour). The exchange path shares the same per-IP budget (20 per
175+
hour), which is the effective control against code guessing. Device-link
176+
codes expire after 5 minutes.
176177

177178
The branded email templates (invite, magic link, confirmation, recovery,
178179
email-change, reauthentication) live in `supabase/templates/`. Customizing

docs/flows.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,10 @@ sequenceDiagram
211211
Contributor sign-in codes and device-link codes share the same bridge: they
212212
are 8 characters from an unambiguous alphabet (32⁸ ≈ 1.1×10¹²), single-use
213213
with an atomic consume, expire after 20 minutes (device links: 5), are
214-
stored only as SHA-256 hashes, and invalidate after 10 failed attempts.
215-
Minting is throttled to 3 codes per user per 20 minutes and every issuance
216-
is written to `audit_events`.
214+
stored only as SHA-256 hashes. Code guessing is rate-limited per source
215+
IP: a shared 20-per-hour budget covers both minting and exchange. Minting is
216+
throttled to 3 codes per user per 20 minutes and every issuance is written
217+
to `audit_events`.
217218

218219
---
219220

0 commit comments

Comments
 (0)