MetaMask / MetaMask/metamask-extension

[Bug]: Signatures - MM breaks with the error `TypeError: e.map is not a function` when triggering a malformed signature with invalid type

Open
#32,373 0 comments 0 reactions 0 assignees View on GitHub
Bugs---Low-Priority INVALID-ISSUE-TEMPLATE regression-RC-12.18.0 Sev2-normal team-confirmations type-bug
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

**Describe the bug**

MetaMask breaks with the error `TypeError: e.map is not a function` when triggering a malformed signature with invalid type

**Expected behavior**

Not sure how we want to handle an invalid type passed in the message for typed signatures (possibly just throw an error without opening the dialog?).
Before 12.18.0, the wallet didn't break, that's why I added the regression RC label, though not sure if that was correct neither (I don't think so)

**Screenshots/Recordings**

![Image](https://github.com/user-attachments/assets/5453225e-f2be-4fe6-981d-39f830bd8e9a)

https://github.com/user-attachments/assets/9d565a3e-1fcd-4e9c-897e-1dadc2ab52c8

**Steps to reproduce**

1. Go to the test dapp
2. Connect
3. Click Invalid Type signature
4. See wallet breaks

**Error messages or log output**

```shell

```

**Detection stage**

During release testing

**Version**

12.18.0

**Build type**

None

**Browser**

Chrome

**Operating system**

Linux

Contributor guide

Open the contributing guide

Research direction

Start with the test dapp's “Invalid Type signature” flow and trace the typed-signature handling that leads to `TypeError: e.map is not a function`. Reproduce it on version 12.18.0, then verify that the wallet no longer breaks when an invalid type is submitted and that the chosen error behavior is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.