MetaMask / MetaMask/providers

Refactor @metamask/providers and make it use #hashFunctions for private methods

Open
#244 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type-security
Dominant language
TypeScript
Stars
268
Forks
130
PR merge metrics
No merged PRs in 30d

Description

This is a proposal to do refactoring of the `@metamask/providers` `StreamProvider` and make its private methods and properties use `#hash` approach if possible. That way it would not be exposing methods and properties within its prototype chain which can be a security concern.

It is discovered that `harden` function from [Secure EcmaScript](https://www.npmjs.com/package/ses) which is used in Snaps and LavaMoat, is freezing some parts of the stream which makes it impossible to work. Because of that, a special way of using Proxy was introduced. By having a real private methods and properties it might be easier to secure this type of issues in the future.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the @metamask/providers StreamProvider implementation and reviewing how its private methods and properties are exposed through the prototype chain. Read the issue’s context about SES harden, Snaps, LavaMoat, and the Proxy workaround. Done means determining whether # private methods and properties can replace the current approach without breaking stream behavior or security.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
security
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.