Refuse look-alike handles and throwaway addresses at sign-up #74

Merged
paulhitt merged 1 commits from feat/signup-validation into main 2026-09-03 00:16:30 +00:00
paulhitt commented 2026-09-02 00:05:03 +00:00 (Migrated from gitlab.com)

Closes part of #42.

Look-alike handles. User.normalize already refuses two accounts differing only in
case — its own comment calls that an impersonation primitive. A digit drawn like a letter
is the same attack: paulh1tt beside paulhitt.

User.confusableSkeleton folds ten single-character swaps, stored in an indexed
username_skeleton column so the check is a lookup, not a scan.

Both creation paths. signup, and the provisioning route for accounts
authenticated elsewhere — a check on only the password path is one an impersonator walks
around.

Deliberately not rn → m. Real, but it folds corner into comer, and
refusing an ordinary word costs a legitimate sign-up.
testOrdinaryDifferentNamesDoNotCollide holds that line.

The migration backfills, or every existing account stays freely impersonable.
Folded in Swift, not SQL, so the mapping cannot drift from a second copy.

Throwaway addresses. Short built-in list, extendable via
FN_DISPOSABLE_EMAIL_DOMAINS, matches domain and subdomains. Not a security control —
it raises the floor on bulk sign-ups, and the email is how somebody gets back in.

Tests: 9 new, proven able to fail (weakening the fold turns the look-alike test red on
four pairs). 470 tests in 40 suites still pass.

Not deployed and not to be deployed from this MR. Adds a migration that runs at
boot; production is fine as it stands.

Closes part of #42. **Look-alike handles.** `User.normalize` already refuses two accounts differing only in case — its own comment calls that an impersonation primitive. A digit drawn like a letter is the same attack: `paulh1tt` beside `paulhitt`. `User.confusableSkeleton` folds ten single-character swaps, stored in an indexed `username_skeleton` column so the check is a lookup, not a scan. **Both creation paths.** `signup`, and the provisioning route for accounts authenticated elsewhere — a check on only the password path is one an impersonator walks around. **Deliberately not `rn` → `m`.** Real, but it folds `corner` into `comer`, and refusing an ordinary word costs a legitimate sign-up. `testOrdinaryDifferentNamesDoNotCollide` holds that line. **The migration backfills**, or every existing account stays freely impersonable. Folded in Swift, not SQL, so the mapping cannot drift from a second copy. **Throwaway addresses.** Short built-in list, extendable via `FN_DISPOSABLE_EMAIL_DOMAINS`, matches domain and subdomains. Not a security control — it raises the floor on bulk sign-ups, and the email is how somebody gets back in. **Tests:** 9 new, proven able to fail (weakening the fold turns the look-alike test red on four pairs). 470 tests in 40 suites still pass. **Not deployed and not to be deployed from this MR.** Adds a migration that runs at boot; production is fine as it stands.
paulhitt commented 2026-09-02 00:43:57 +00:00 (Migrated from gitlab.com)

mentioned in commit flamenet-messenger-ios@6407448af2ded8a9fe95b113b8a98f2624304396

mentioned in commit flamenet-messenger-ios@6407448af2ded8a9fe95b113b8a98f2624304396
paulhitt commented 2026-09-02 00:44:11 +00:00 (Migrated from gitlab.com)

mentioned in merge request flamenet-messenger-ios!45

mentioned in merge request flamenet-messenger-ios!45
paulhitt commented 2026-09-02 00:48:15 +00:00 (Migrated from gitlab.com)

mentioned in commit flamenet-messenger-android@e5f4397b28fa8ccaf3cfa7be8f769386a5454892

mentioned in commit flamenet-messenger-android@e5f4397b28fa8ccaf3cfa7be8f769386a5454892
paulhitt commented 2026-09-02 00:48:25 +00:00 (Migrated from gitlab.com)

mentioned in merge request flamenet-messenger-android!9

mentioned in merge request flamenet-messenger-android!9
paulhitt commented 2026-09-02 14:56:42 +00:00 (Migrated from gitlab.com)

mentioned in merge request !25

mentioned in merge request !25
paulhitt commented 2026-09-03 00:16:18 +00:00 (Migrated from gitlab.com)

added 31 commits

  • f688d75a...28fe68dc - 30 commits from branch main
  • 54e1c2b9 - Refuse look-alike handles and throwaway addresses at sign-up

Compare with previous version

added 31 commits <ul><li>f688d75a...28fe68dc - 30 commits from branch <code>main</code></li><li>54e1c2b9 - Refuse look-alike handles and throwaway addresses at sign-up</li></ul> [Compare with previous version](/paulhitt/flamenet-relay/-/merge_requests/11/diffs?diff_id=2001158153&start_sha=f688d75afa02d349c0f28ee8cabda8b972761b24)
paulhitt commented 2026-09-03 00:16:30 +00:00 (Migrated from gitlab.com)

mentioned in commit 67b7e2196c

mentioned in commit 67b7e2196c68784d02d289c2437b6b567d34d4be
paulhitt (Migrated from gitlab.com) merged commit 67b7e2196c into main 2026-09-03 00:16:30 +00:00
paulhitt commented 2026-09-03 19:49:57 +00:00 (Migrated from gitlab.com)

mentioned in commit flamenet-messenger-ios@77b3581f16db331996cd6a493fb8b756c4578034

mentioned in commit flamenet-messenger-ios@77b3581f16db331996cd6a493fb8b756c4578034
paulhitt commented 2026-09-03 19:50:06 +00:00 (Migrated from gitlab.com)

mentioned in merge request flamenet-messenger-ios!91

mentioned in merge request flamenet-messenger-ios!91
paulhitt commented 2026-09-03 23:23:55 +00:00 (Migrated from gitlab.com)

mentioned in commit flamenet-messenger-android@8a1a51073e984e0f6a59584548ab4a537e5f1576

mentioned in commit flamenet-messenger-android@8a1a51073e984e0f6a59584548ab4a537e5f1576
paulhitt commented 2026-09-09 18:59:22 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
Sign in to join this conversation.