Skip to content

fix(web3): always bind SIWE/SIWS Domain to URI host - #2687

Open
SashaMIT wants to merge 1 commit into
supabase:masterfrom
SashaMIT:fix/web3-localhost-domain-bind
Open

fix(web3): always bind SIWE/SIWS Domain to URI host#2687
SashaMIT wants to merge 1 commit into
supabase:masterfrom
SashaMIT:fix/web3-localhost-domain-bind

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 8, 2026

Copy link
Copy Markdown

Summary

Domain matching for Web3 SIWE/SIWS grants was skipped when URI.Hostname() == "localhost". That let a signed message with Domain=attacker.example and an allowlisted URI=http://localhost:5173/ skip the domain bind while still passing the URI allowlist.

This change always requires URI.Host == Domain. The existing https://{Domain}/ allowlist check remains for non-localhost hosts so legitimate localhost happy-path fixtures keep working.

Test plan

  • CI green
  • Local: Solana mismatched-domain path still returns invalid_grant (domain bind)
  • Confirm localhost happy-path messages with matching Domain/URI still succeed in full suite

Made with Cursor

Domain matching was skipped when URI.Hostname() was localhost, so a
message with Domain=attacker.example and URI=http://localhost:5173/
could pass URI allowlist checks and skip domain bind. Require
URI.Host == Domain for all hosts; keep the existing https Domain
allowlist check for non-localhost.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant