Repository navigation
fix: reject line breaks in SIWE statements - #5608
Closed
gomesalexandre wants to merge 2 commits into
Closed
gomesalexandre wants to merge 2 commits into
gomesalexandre wants to merge 2 commits into
Conversation
Reject CR, LF, U+2028, and U+2029 in the statement so parseSiweMessage cannot return suffix fields when a line terminator splits the statement. Co-authored-by: Cursor <[email protected]>
Co-Authored-By: Cursor Grok 4.7 <[email protected]>
|
@gomesalexandre 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: 7ecd7aa 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 |
Member
|
Thanks @gomesalexandre! This is continued in #5609, which keeps your commits and also rejects a statement line break followed by a single LF before the suffix, plus the same characters in createSiweMessage. |
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.
parseSiweMessagetook the statement with a greedy group that stops at CR, LF, U+2028, and U+2029. A statement offoo, then one of those characters, thenURI: https://evil.examplestill returned the real domain, address, URI, version, chain id, nonce, and issued-at, and omitted the statement. The parsed message no longer matches the signed text. This is the same class as ox #699.The statement section between the address blank line and the URI blank line is now rejected when it contains one of those characters. An empty statement is unchanged, because that section has length 0.
On main the new test expected
{}and got the parsed suffix fields. On this branch that test passes.