Repository navigation
fix(siwe): reject a line break in createSiweMessage requestId - #5559
pucedoteth wants to merge 1 commit into
Conversation
`createSiweMessage` validated every field except `requestId`. A line break in it started a new field, so a request ID could append lines such as a `Resources` section to the message the user signs, and `parseSiweMessage` read them back as resources. Reject it like a line break in `statement`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01L75E8Ap183JW1mDfv8arqR
|
@pucedoteth is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: e8c7d42 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The
So the text the user signs and what a verifier reads back still differ. ox's |
|
Thanks @pucedoteth! We carried this forward in #5580 with your commit intact, adding a check for a lone |
createSiweMessagevalidates every field exceptrequestId. A line break in it starts a new field, so a request ID can append lines to the message the user signs:produces
and
parseSiweMessagereads it back as{ requestId: 'foo', resources: ['https://example.com/admin'] }. Noresourceswere passed, so the injected one also skips theisUricheck thatresourcesentries get.EIP-4361 defines
request-idas*pchar, which excludes line breaks. This rejects a\ninrequestIdwithSiweInvalidMessageFieldError, the same waystatementis handled. It affects apps that put caller-controlled text inrequestId; an app-generated ID such as a UUID is unaffected.behavior: invalid requestId. It fails without this change and passes with it.src/utils/siwetests pass (91), and biome andtscare clean.