Repository navigation
fix(Siwe): assume https in validateMessage when the message omits scheme - #712
Merged
Merged
Conversation
Same fix as wevm/viem#5621 for validateSiweMessage. Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
|
@HereForTheTechNFT is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
jxom
added a commit
that referenced
this pull request
Nov 20, 2026
#713) * fix(Siwe): assume https in validateMessage when the message omits scheme Same fix as wevm/viem#5621 for validateSiweMessage. Co-authored-by: Claude <[email protected]> Co-authored-by: jxom <[email protected]> * test(Siwe): cover the default https scheme in validateMessage Co-authored-by: Claude <[email protected]> Co-authored-by: jxom <[email protected]> * chore: add changeset for the Siwe default scheme fix Co-authored-by: Claude <[email protected]> Co-authored-by: jxom <[email protected]> --------- Co-authored-by: forthetech.eth <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: jxom <[email protected]>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of wevm/viem#5621, as suggested by @erkancamli in that PR.
EIP-4361 says that when
schemeis not specified, HTTPS is assumed.Siwe.parseMessagereturnsscheme: undefinedfor a message without a scheme prefix, soSiwe.validateMessage({ message, scheme: 'https' })returnedfalsefor it (message.scheme !== scheme). The check now usesmessage.scheme ?? 'https'. The JSDoc of theschemeoption mentions the default, and apatchchangeset is included.Test
New case in
src/core/_test/Siwe.test.ts: a message withoutschemevalidates against'https'and not against'http'. It fails on main 2d43a3a and passes with the fix. All 140 tests inSiwe.test.tspass. I ran that file with a minimal vitest config (thecoreproject's global setup starts an anvil instance, which my sandbox can't bind).vp lintis clean.vp fmt --checkonly flags lines that are already unformatted on main inSiwe.test.ts, not the new ones.If you want it on
0.xas well, I can open the backport.🤖 Generated with Claude Code
https://claude.ai/code/session_014cRzwuyJe8BGwXowsQ3kpw