Repository navigation
fix: reject every line break in Siwe.createMessage statement - #699
Closed
gomesalexandre wants to merge 1 commit into
Closed
gomesalexandre wants to merge 1 commit into
gomesalexandre wants to merge 1 commit into
Conversation
`createMessage` only rejected `\n`, so a statement with `\r`, U+2028 or
U+2029 produced a message that `parseMessage` reads back as `{}`: the
prefix regex matches the statement with `.`, which stops at all four.
EIP-4361 keeps the statement on one line, and `requestId` already
rejects `\r` (wevm#642).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@gomesalexandre is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Nov 19, 2026
Member
|
Thanks @gomesalexandre! We opened #705 combining this with #696 and #698 (they conflicted), crediting you as co-author, with the changeset trimmed to one sentence and the new cases as inline error snapshots. Closing in favor of it. |
jxom
added a commit
that referenced
this pull request
Nov 19, 2026
#705) Rejects a comma in `scheme`, rejects `\r`, U+2028 and U+2029 in `statement`, and accepts IP literal `domain` values without letting a userinfo authority such as `[evil.com@[::1]` through. Supersedes #696, #698, and #699. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f5cc-eb3a-72b3-bdda-0480feddb7f9 Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: gomes <17035424+gomesalexandre@users.noreply.github.com> Co-authored-by: jxom <jake@tempo.xyz>
jxom
added a commit
that referenced
this pull request
Nov 19, 2026
* fix: hash zero-valued leaves in `BinaryStateTree.merkelize` (#690) EIP-7864 only maps the 64-byte zero input to the zero hash, so a leaf set to 32 zero bytes is a real leaf. `hash` zeroed any all-zero input, which merkelized zero-valued leaves as empty (a lone zero leaf at the zero key gave the empty-tree root). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1f5cc-eb3a-72b3-bdda-0480feddb7f9 Co-authored-by: jxom <jake@tempo.xyz> * fix: encode legacy `v` above 255 in `Transaction.toRpc` (#691) `Transaction.toRpc` encoded `v` with `size: 1` for every transaction type. A legacy EIP-155 `v` is `chainId * 2 + 35 + yParity`, so from chain ID 110 on (Polygon, Base, Arbitrum, ...) it passes 255 and `toRpc` threw `Hex.IntegerOutOfRangeError`. `toRpc(fromRpc(tx))` failed on real legacy transactions from those chains. execution-apis types the legacy `v` as `uint` and the typed `v` as `byte`, so legacy now encodes it without a size and typed transactions keep the single byte. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 6b94083) Co-authored-by: jxom <jake@tempo.xyz> * fix: encode authorization `r` and `s` as quantities in `Authorization.toRpc` (#693) execution-apis types authorization list `r` and `s` as `uint256`, so nodes expect them without leading zeros. `Authorization.toRpc` passed the 32-byte padded values through, and geth-based nodes reject them in `eth_estimateGas`, `eth_call` and `eth_sendTransaction` ("hex number with leading zero digits") whenever the top nibble is zero. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit d7b57e1) Co-authored-by: jxom <jake@tempo.xyz> * fix: keep `requestsHash` in `Block.toRpc` (#703) Supersedes #692. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f5cc-eb3a-72b3-bdda-0480feddb7f9 Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: gomes <17035424+gomesalexandre@users.noreply.github.com> Co-authored-by: jxom <jake@tempo.xyz> (cherry picked from commit b31cd5d) * fix: encode `BlockOverrides` `prevRandao` as a 32-byte hash (#704) Supersedes #700. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f5cc-eb3a-72b3-bdda-0480feddb7f9 Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: Martina <261225237+Iamsohungrynow@users.noreply.github.com> Co-authored-by: jxom <jake@tempo.xyz> (cherry picked from commit 9c3280b) * fix(0.x): reject a comma in `Siwe` `scheme` and every line break in `statement` Ports the scheme and statement parts of #705 (from #698 and #699). The IP literal domain part does not apply to 0.x. Co-authored-by: gomes <17035424+gomesalexandre@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1f5cc-eb3a-72b3-bdda-0480feddb7f9 Co-authored-by: jxom <jake@tempo.xyz> * docs: fix stated outputs in hash and selector examples (#702) (cherry picked from commit 2d43a3a) Co-authored-by: jxom <jake@tempo.xyz> --------- Co-authored-by: gomes <17035424+gomesalexandre@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: jxom <jake@tempo.xyz> Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: Martina <261225237+Iamsohungrynow@users.noreply.github.com>
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.
Siwe.createMessageonly rejected\ninstatement, so a statement containing\r, U+2028 or U+2029 produced a message thatSiwe.parseMessagereads back as{}:prefixRegexmatches the statement with., which stops at all four line terminators. EIP-4361 keeps the statement on a single line, andrequestIdalready rejects\rsince #642. A statement likefoo\rURI: https://evil.examplewas also signable, and could show up as a fake field in a wallet that renders CR as a line break. This rejects all four with onestatementLineBreakRegexand lists them in the error.The new test fails on
mainandSiwe.test.tspasses 118/118 with this change. viem'screateSiweMessagehas the sameincludes('\n')check, so it would need the same change to stay in sync.🤖 Generated with Claude Code