MetaMask / MetaMask/eth-sig-util

`signTypedData` input validation

Open
#209 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
583
Forks
228
Avg merge
11h 22m
Merged PRs (30d)
7

Description

We don't have much in the way of input validation for `signTypedData`. This is dangerous because invalid inputs can result in non-standard encodings.

Some examples of this are:
* Negative `uint` values are currently encoded as positive values. The negative is ignored.
* Some out-of-bounds integer values and byte values are possible to encode right now.
* We don't validate address input, so the `address` field can be used to store values far larger than an address.

We should strictly validate input, so that users don't accidentally become reliant upon non-standard and non-portable encodings.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the signTypedData entry point and trace how integer, byte, and address inputs are encoded. Use the listed negative, out-of-bounds, and oversized-address examples to define rejection behavior; done means invalid inputs are rejected and valid encodings remain standard and portable. Add focused tests for each validation case.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cryptography, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.