MetaMask / MetaMask/metamask-extension

Nested Tuple methods do not decode trough 4bytes

Open
#35,599 0 comments 0 reactions 0 assignees View on GitHub
external-contributor
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

### What is this about?

Currently metamask relies its ability to decode the method calls on a 3rd party provider - [4bytes.directory](https://www.4byte.directory/)

However 4byte will not work with advanced method calls where nested tuples are present. [Issue at 4byte repository](https://github.com/gobitfly/ethereum-function-signature-registry/issues/20) been standing with no activity for over a month now, hence Im escalating this to your repository.

Since method signature decoding is paramount security feature, this causes soft denial of service to any product or app that creates advanced interfaces that fail on 4bytes.

### Scenario

As reference you can take [our contract, deployed on arb sepolia](https://sepolia.arbiscan.io/address/0xc40c5b5cc145919b39c4687b94527ebd607ac266#multipleProxyContract) or refer to our [repo for method is not possible to verify on 4bytes](https://github.com/peeramid-labs/rankify-contracts/blob/main/src/facets/RankifyInstanceMainFacet.sol#L123) (abis to copy present in 4bytes issue), hence metamask also fails to decode it for the end user, which causes security issues for anyone willing to interact with our system.

To reproduce:

1/ Take any nested tuple method and try to validate it against 4bytes directory

### Design

While straightforward solution would be to poke 4bytes maintainers to fixing this, this leaves question open regarding central point of failure in such security sensitive part of user interfaces. We all know how much compromises there cost.

Ideally developers should have permission less way of uploading such data. One way we could develop is create2 contract registry that can act as fallback source of truth.

### Technical Details

_No response_

### Threat Modeling Framework

_No response_

### Acceptance Criteria

_No response_

### Stakeholder review needed before the work gets merged

- [ ] Engineering (needed in most cases)
- [ ] Design
- [ ] Product
- [ ] QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management (please specify)
- [ ] Other (please specify)

### References

_No response_

Contributor guide

Open the contributing guide

Research direction

No source file, test, technical design, or acceptance criteria is named. Start by reproducing the nested-tuple decoding failure using the linked contract or ABI and the 4bytes reference issue, then locate MetaMask's method-signature decoding entry point. Done is not defined; the scope and success criteria need to be agreed before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.