Skip to content
This repository was archived by the owner on Nov 9, 2026. It is now read-only.
This repository was archived by the owner on Nov 9, 2026. It is now read-only.

signTypedData input validation #209

Open

Description

@Gudahtt

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.

Activity

  1. changed the title [-]`signTypedData` Input validation[/-] [+]`signTypedData` input validation[/+] on Sep 16, 2021
  2. added this to the signTypedData_v5 milestone on Sep 16, 2021
  3. Gudahtt commented on Apr 16, 2024

    @Gudahtt
    MemberAuthor

    We should also validate that the order of fields in the domainSeparator matches the specification. We have found that some hardware wallets (e.g. Keystone) will reorder fields to match the specification, so if we don't validate that ourselves the signatures won't be verifiable.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions