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
- 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**

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
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