-
Notifications
You must be signed in to change notification settings - Fork 622
fix(web3): normalize Ethereum addresses to lowercase to prevent case-...#2265
fix(web3): normalize Ethereum addresses to lowercase to prevent case-... #2265lingcoder wants to merge 4 commits intosupabase:master from
Conversation
cemalkilic
commented
Nov 27, 2025
Thanks for spotting the issue & contributing the fix @lingcoder !
Can you please also update the test?
auth/internal/utilities/siwe/parser_test.go
Line 119 in 9f39cad
3d55a11 to
776d2c6
Compare
cd7781a to
43314eb
Compare
cemalkilic
commented
Jan 8, 2026
Hello! I reviewed this PR again and a quick note on the migration.
auth.identities can be massive on some projects, and the backfill UPDATE worries me (long run time, locks). We do have an index from UNIQUE (provider_id, provider), but since provider isn’t indexed on its own, WHERE provider = 'web3' can still end up doing a big scan.
What about skipping the bulk backfill and whoever needs backfilling can run manual queries?
lingcoder
commented
Jan 11, 2026
Thanks for the feedback @cemalkilic! I've removed the bulk backfill migration as suggested. The code change will handle new signups automatically, and I've added migration notes in the PR description for existing deployments that may need to run manual queries.
Remove the bulk UPDATE migration for normalizing Ethereum addresses as suggested by @cemalkilic. The auth.identities table can be massive on some projects, and the backfill UPDATE could cause long run times and locks. The code change in parser.go will handle new signups automatically. Existing deployments with web3 users can run manual migration queries if needed (see PR description for migration notes).
3741cf0 to
50bc2f8
Compare
Uh oh!
There was an error while loading. Please reload this page.
fix(web3): normalize Ethereum addresses to lowercase to prevent case-sensitivity issues #2264
What kind of change does this PR introduce?
Bug fix - Resolves case-sensitivity issues with Ethereum addresses in SIWE (Sign-In with Ethereum) implementation.
What is the current behavior?
Ethereum addresses are stored with their original case (EIP-55 checksum format uses mixed case). This causes lookup failures when users sign in with a different case representation of the same address, as
provider_idmatching is case-sensitive.What is the new behavior?
Ethereum addresses are now normalized to lowercase at parse time in
parser.go. This ensures consistent storage and lookup regardless of the case used during sign-in.Changes:
internal/utilities/siwe/parser.go- Normalize address to lowercaseinternal/utilities/siwe/parser_test.go- Update test expectationsMigration Notes
This fix applies to new signups only. Existing users with checksummed Ethereum addresses in
provider_idmay need manual migration.For existing deployments with web3 users:
Note: For large tables, consider running in batches to avoid long locks.
Additional context
auth.identitiestables