Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.

Add validateMessage option to signMessage#148

Merged
legobeat merged 1 commit intoMetaMask:mainfrom
legobeat:validateMessage
Sep 12, 2023
Merged

Add validateMessage option to signMessage#148
legobeat merged 1 commit intoMetaMask:mainfrom
legobeat:validateMessage

Conversation

@legobeat
Copy link
Copy Markdown
Contributor

@legobeat legobeat commented Sep 1, 2023

signMessage is supposed to be rejecting malformed input but relies on implicit behavior in dependencies to do so. This makes it brittle and it can be seen failing here: https://github.com/MetaMask/eth-simple-keyring/actions/runs/6053985322/job/16430596839

This adds validation that the string has a length and is a hexadecimal string with optional 0x-prefix. It makes it optional via the new validateMessage option (default: true)

Copy link
Copy Markdown
Member

@mikesposito mikesposito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

type-bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants