You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`[a-zA-Z0-9+-.]` reads `+-.` as a character range, so it matches `+ , - .`.
The intended set is the RFC 3986 one, `+`, `-` and `.`, so a comma was allowed
in a SIWE scheme by both sides:
createSiweMessage({ ..., scheme: 'ht,tps' }) // accepted
parseSiweMessage('ht,tps://example.com ...') // scheme: 'ht,tps'
createSiweMessage validates the scheme specifically to enforce RFC 3986 3.1,
and its own error message says so, so accepting a comma is not intentional
leniency. siwe/utils.ts already writes the same class correctly as
`[a-z0-9+\\-.]` in isUri.
Escape the hyphen in both. The domain class is left as it is: RFC 3986
reg-name does allow a comma via sub-delims, and parseSiweMessage is
deliberately lenient there.
Fixed the SIWE scheme check accepting a comma. `[a-zA-Z0-9+-.]` reads `+-.` as a character range (`+``,``-``.`), so `createSiweMessage` did not reject a scheme such as `ht,tps` despite validating against RFC 3986, and `parseSiweMessage` returned it as `scheme`.
0 commit comments