From 2eced173cb21121a054ec5f271391f7dcc005068 Mon Sep 17 00:00:00 2001 From: Jyoti Puri Date: Fri, 20 Dec 2024 17:41:44 +0530 Subject: [PATCH] fix: Adding validation for primary type of types sign signatures (#29379) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Types sign request to not allow invalid primary types. ## **Related issues** Fixes: https://github.com/MetaMask/metamask-extension/issues/22899 ## **Manual testing steps** 1. Go to test dapp 2. Submit signature with text "Invalid primary type" 3. Request should be rejected and not open MetaMask ## **Screenshots/Recordings** Screenshot 2024-12-20 at 3 34 16 PM ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: MetaMask Bot --- lavamoat/browserify/beta/policy.json | 139 ++++++++++++++++++++++++-- lavamoat/browserify/flask/policy.json | 139 ++++++++++++++++++++++++-- lavamoat/browserify/main/policy.json | 139 ++++++++++++++++++++++++-- lavamoat/browserify/mmi/policy.json | 139 ++++++++++++++++++++++++-- package.json | 2 +- yarn.lock | 107 ++++++++++++-------- 6 files changed, 596 insertions(+), 69 deletions(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 05a22743204c..ee84b5c3e0e8 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -803,6 +803,30 @@ "@metamask/abi-utils>@metamask/utils": true } }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/eth-json-rpc-middleware>@metamask/utils": true + } + }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + } + }, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + } + }, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + } + }, "@metamask/accounts-controller": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, @@ -1022,7 +1046,7 @@ "setTimeout": true }, "packages": { - "@metamask/eth-sig-util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": true, "@metamask/json-rpc-engine": true, "@metamask/rpc-errors": true, "@metamask/eth-json-rpc-middleware>@metamask/utils": true, @@ -1075,11 +1099,22 @@ "@metamask/eth-sig-util>tweetnacl": true } }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-json-rpc-middleware>@metamask/utils": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/eth-sig-util>tweetnacl": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/abi-utils": true, - "@metamask/eth-snap-keyring>@metamask/utils": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, "@ethereumjs/tx>ethereum-cryptography": true, @@ -1089,7 +1124,7 @@ "@metamask/keyring-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/abi-utils": true, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils": true, "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, @@ -1100,7 +1135,7 @@ "@metamask/signature-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/abi-utils": true, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils": true, "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, @@ -1272,7 +1307,7 @@ "packages": { "@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/utils": true + "@metamask/json-rpc-engine>@metamask/utils": true } }, "@metamask/json-rpc-middleware-stream": { @@ -1595,7 +1630,7 @@ }, "@metamask/rpc-errors": { "packages": { - "@metamask/utils": true, + "@metamask/rpc-errors>@metamask/utils": true, "@metamask/rpc-errors>fast-safe-stringify": true } }, @@ -1861,6 +1896,51 @@ "semver": true } }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/browser-passworder>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1966,6 +2046,21 @@ "semver": true } }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2026,6 +2121,21 @@ "semver": true } }, + "@metamask/json-rpc-engine>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/keyring-api>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2116,6 +2226,21 @@ "semver": true } }, + "@metamask/rpc-errors>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/rate-limit-controller>@metamask/rpc-errors>@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 05a22743204c..ee84b5c3e0e8 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -803,6 +803,30 @@ "@metamask/abi-utils>@metamask/utils": true } }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/eth-json-rpc-middleware>@metamask/utils": true + } + }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + } + }, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + } + }, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + } + }, "@metamask/accounts-controller": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, @@ -1022,7 +1046,7 @@ "setTimeout": true }, "packages": { - "@metamask/eth-sig-util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": true, "@metamask/json-rpc-engine": true, "@metamask/rpc-errors": true, "@metamask/eth-json-rpc-middleware>@metamask/utils": true, @@ -1075,11 +1099,22 @@ "@metamask/eth-sig-util>tweetnacl": true } }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-json-rpc-middleware>@metamask/utils": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/eth-sig-util>tweetnacl": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/abi-utils": true, - "@metamask/eth-snap-keyring>@metamask/utils": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, "@ethereumjs/tx>ethereum-cryptography": true, @@ -1089,7 +1124,7 @@ "@metamask/keyring-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/abi-utils": true, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils": true, "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, @@ -1100,7 +1135,7 @@ "@metamask/signature-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/abi-utils": true, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils": true, "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, @@ -1272,7 +1307,7 @@ "packages": { "@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/utils": true + "@metamask/json-rpc-engine>@metamask/utils": true } }, "@metamask/json-rpc-middleware-stream": { @@ -1595,7 +1630,7 @@ }, "@metamask/rpc-errors": { "packages": { - "@metamask/utils": true, + "@metamask/rpc-errors>@metamask/utils": true, "@metamask/rpc-errors>fast-safe-stringify": true } }, @@ -1861,6 +1896,51 @@ "semver": true } }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/browser-passworder>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1966,6 +2046,21 @@ "semver": true } }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2026,6 +2121,21 @@ "semver": true } }, + "@metamask/json-rpc-engine>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/keyring-api>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2116,6 +2226,21 @@ "semver": true } }, + "@metamask/rpc-errors>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/rate-limit-controller>@metamask/rpc-errors>@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 05a22743204c..ee84b5c3e0e8 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -803,6 +803,30 @@ "@metamask/abi-utils>@metamask/utils": true } }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/eth-json-rpc-middleware>@metamask/utils": true + } + }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + } + }, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + } + }, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + } + }, "@metamask/accounts-controller": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, @@ -1022,7 +1046,7 @@ "setTimeout": true }, "packages": { - "@metamask/eth-sig-util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": true, "@metamask/json-rpc-engine": true, "@metamask/rpc-errors": true, "@metamask/eth-json-rpc-middleware>@metamask/utils": true, @@ -1075,11 +1099,22 @@ "@metamask/eth-sig-util>tweetnacl": true } }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-json-rpc-middleware>@metamask/utils": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/eth-sig-util>tweetnacl": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/abi-utils": true, - "@metamask/eth-snap-keyring>@metamask/utils": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, "@ethereumjs/tx>ethereum-cryptography": true, @@ -1089,7 +1124,7 @@ "@metamask/keyring-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/abi-utils": true, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils": true, "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, @@ -1100,7 +1135,7 @@ "@metamask/signature-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/abi-utils": true, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils": true, "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, @@ -1272,7 +1307,7 @@ "packages": { "@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/utils": true + "@metamask/json-rpc-engine>@metamask/utils": true } }, "@metamask/json-rpc-middleware-stream": { @@ -1595,7 +1630,7 @@ }, "@metamask/rpc-errors": { "packages": { - "@metamask/utils": true, + "@metamask/rpc-errors>@metamask/utils": true, "@metamask/rpc-errors>fast-safe-stringify": true } }, @@ -1861,6 +1896,51 @@ "semver": true } }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/browser-passworder>@metamask/utils": { "globals": { "TextDecoder": true, @@ -1966,6 +2046,21 @@ "semver": true } }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2026,6 +2121,21 @@ "semver": true } }, + "@metamask/json-rpc-engine>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/keyring-api>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2116,6 +2226,21 @@ "semver": true } }, + "@metamask/rpc-errors>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/rate-limit-controller>@metamask/rpc-errors>@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index 27ddfc86ff15..831feb96e1c5 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -895,6 +895,30 @@ "@metamask/abi-utils>@metamask/utils": true } }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/eth-json-rpc-middleware>@metamask/utils": true + } + }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + } + }, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + } + }, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils": { + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + } + }, "@metamask/accounts-controller": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, @@ -1114,7 +1138,7 @@ "setTimeout": true }, "packages": { - "@metamask/eth-sig-util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": true, "@metamask/json-rpc-engine": true, "@metamask/rpc-errors": true, "@metamask/eth-json-rpc-middleware>@metamask/utils": true, @@ -1167,11 +1191,22 @@ "@metamask/eth-sig-util>tweetnacl": true } }, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": { + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-json-rpc-middleware>@metamask/utils": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "@ethereumjs/tx>ethereum-cryptography": true, + "@metamask/eth-sig-util>tweetnacl": true + } + }, "@metamask/eth-snap-keyring>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/abi-utils": true, - "@metamask/eth-snap-keyring>@metamask/utils": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, "@ethereumjs/tx>ethereum-cryptography": true, @@ -1181,7 +1216,7 @@ "@metamask/keyring-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/abi-utils": true, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils": true, "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, @@ -1192,7 +1227,7 @@ "@metamask/signature-controller>@metamask/eth-sig-util": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/abi-utils": true, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils": true, "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, @@ -1364,7 +1399,7 @@ "packages": { "@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/utils": true + "@metamask/json-rpc-engine>@metamask/utils": true } }, "@metamask/json-rpc-middleware-stream": { @@ -1687,7 +1722,7 @@ }, "@metamask/rpc-errors": { "packages": { - "@metamask/utils": true, + "@metamask/rpc-errors>@metamask/utils": true, "@metamask/rpc-errors>fast-safe-stringify": true } }, @@ -1953,6 +1988,51 @@ "semver": true } }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, + "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/browser-passworder>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2058,6 +2138,21 @@ "semver": true } }, + "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2118,6 +2213,21 @@ "semver": true } }, + "@metamask/json-rpc-engine>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/keyring-api>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2208,6 +2318,21 @@ "semver": true } }, + "@metamask/rpc-errors>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/utils>@metamask/superstruct": true, + "@noble/hashes": true, + "@metamask/utils>@scure/base": true, + "browserify>buffer": true, + "nock>debug": true, + "@metamask/utils>pony-cause": true, + "semver": true + } + }, "@metamask/rate-limit-controller>@metamask/rpc-errors>@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/package.json b/package.json index 4534c2c15c2f..1b09e5a96d7e 100644 --- a/package.json +++ b/package.json @@ -296,7 +296,7 @@ "@metamask/ens-controller": "^15.0.0", "@metamask/ens-resolver-snap": "^0.1.2", "@metamask/eth-json-rpc-filters": "^9.0.0", - "@metamask/eth-json-rpc-middleware": "^15.0.1", + "@metamask/eth-json-rpc-middleware": "^15.1.2", "@metamask/eth-ledger-bridge-keyring": "^5.0.1", "@metamask/eth-query": "^4.0.0", "@metamask/eth-sig-util": "^7.0.1", diff --git a/yarn.lock b/yarn.lock index ed1c8a1de350..530e073f615d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4873,6 +4873,16 @@ __metadata: languageName: node linkType: hard +"@metamask/abi-utils@npm:^3.0.0": + version: 3.0.0 + resolution: "@metamask/abi-utils@npm:3.0.0" + dependencies: + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^11.0.1" + checksum: 10/068b98185148b9e185b4af4392c6a6f82f1d4b1ff60013c57679c618f37afe9030e3ccc940e1a8b690be6f62ea91115ab18b73f3c3c09f4eff1794e31ababb9b + languageName: node + linkType: hard + "@metamask/account-watcher@npm:^4.1.2": version: 4.1.2 resolution: "@metamask/account-watcher@npm:4.1.2" @@ -5260,16 +5270,16 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-block-tracker@npm:^11.0.3": - version: 11.0.3 - resolution: "@metamask/eth-block-tracker@npm:11.0.3" +"@metamask/eth-block-tracker@npm:^11.0.3, @metamask/eth-block-tracker@npm:^11.0.4": + version: 11.0.4 + resolution: "@metamask/eth-block-tracker@npm:11.0.4" dependencies: "@metamask/eth-json-rpc-provider": "npm:^4.1.5" "@metamask/safe-event-emitter": "npm:^3.1.1" - "@metamask/utils": "npm:^9.1.0" + "@metamask/utils": "npm:^11.0.1" json-rpc-random-id: "npm:^1.0.1" pify: "npm:^5.0.0" - checksum: 10/c73a570f889c613ab309643c84a4aed1a4eeed5c101434da84b34babe2352218c65f863602e013a8a55052e3f80a538efed865cc5fb7af558d168c52c5a399a4 + checksum: 10/56b60255a3ae23a378570a49c30d0c13bd74094c0509a978cad20ef57079c80bae91fd35749acb9ac5feef2922eec45a6fef8c0ee6e754cbf3722f8e5d0d771e languageName: node linkType: hard @@ -5311,35 +5321,35 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-json-rpc-middleware@npm:^15.0.1": - version: 15.0.1 - resolution: "@metamask/eth-json-rpc-middleware@npm:15.0.1" +"@metamask/eth-json-rpc-middleware@npm:^15.0.1, @metamask/eth-json-rpc-middleware@npm:^15.1.2": + version: 15.1.2 + resolution: "@metamask/eth-json-rpc-middleware@npm:15.1.2" dependencies: - "@metamask/eth-block-tracker": "npm:^11.0.3" - "@metamask/eth-json-rpc-provider": "npm:^4.1.5" - "@metamask/eth-sig-util": "npm:^7.0.3" - "@metamask/json-rpc-engine": "npm:^10.0.0" - "@metamask/rpc-errors": "npm:^7.0.0" - "@metamask/utils": "npm:^9.1.0" + "@metamask/eth-block-tracker": "npm:^11.0.4" + "@metamask/eth-json-rpc-provider": "npm:^4.1.7" + "@metamask/eth-sig-util": "npm:^8.1.2" + "@metamask/json-rpc-engine": "npm:^10.0.2" + "@metamask/rpc-errors": "npm:^7.0.2" + "@metamask/utils": "npm:^11.0.1" "@types/bn.js": "npm:^5.1.5" bn.js: "npm:^5.2.1" klona: "npm:^2.0.6" pify: "npm:^5.0.0" safe-stable-stringify: "npm:^2.4.3" - checksum: 10/9777fca31440bf0076f5d2c24e2ddb4848ecd9d41b0a5d6114c27339567e60bfcb9057d6bfa81f18f5ca0ffa848ecf9603c765f606b8de206d3e34dba519c501 + checksum: 10/71e7d61cc58df250bfef73438a9e30cc2f78e0e979feb8a9c0be72bbad470a2fe068fa790194cb88ef56865e36156e525272bc3e1a2a7135d07f7bd81a752239 languageName: node linkType: hard -"@metamask/eth-json-rpc-provider@npm:^4.0.0, @metamask/eth-json-rpc-provider@npm:^4.1.5, @metamask/eth-json-rpc-provider@npm:^4.1.6": - version: 4.1.6 - resolution: "@metamask/eth-json-rpc-provider@npm:4.1.6" +"@metamask/eth-json-rpc-provider@npm:^4.0.0, @metamask/eth-json-rpc-provider@npm:^4.1.5, @metamask/eth-json-rpc-provider@npm:^4.1.6, @metamask/eth-json-rpc-provider@npm:^4.1.7": + version: 4.1.7 + resolution: "@metamask/eth-json-rpc-provider@npm:4.1.7" dependencies: - "@metamask/json-rpc-engine": "npm:^10.0.1" - "@metamask/rpc-errors": "npm:^7.0.1" + "@metamask/json-rpc-engine": "npm:^10.0.2" + "@metamask/rpc-errors": "npm:^7.0.2" "@metamask/safe-event-emitter": "npm:^3.0.0" - "@metamask/utils": "npm:^10.0.0" + "@metamask/utils": "npm:^11.0.1" uuid: "npm:^8.3.2" - checksum: 10/aeec2c362a5386357e9f8c707da9baa4326e83889633723656b6801b6461ea8ab8f020b0d9ed0bbc2d8fd6add4af4c99cc9c9a1cbedca267a033a9f19da41200 + checksum: 10/ddfa2a888c83015672a6b879bad061f1e617d6875b741aa714cbe7ac0878dbc8beb9d4ce00ec61a2672d2dfe251f04c4d3eed77b8a9877b7aeb0034eec3e7c51 languageName: node linkType: hard @@ -5381,17 +5391,17 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-sig-util@npm:^8.0.0": - version: 8.0.0 - resolution: "@metamask/eth-sig-util@npm:8.0.0" +"@metamask/eth-sig-util@npm:^8.0.0, @metamask/eth-sig-util@npm:^8.1.2": + version: 8.1.2 + resolution: "@metamask/eth-sig-util@npm:8.1.2" dependencies: "@ethereumjs/util": "npm:^8.1.0" - "@metamask/abi-utils": "npm:^2.0.4" - "@metamask/utils": "npm:^9.0.0" + "@metamask/abi-utils": "npm:^3.0.0" + "@metamask/utils": "npm:^11.0.1" "@scure/base": "npm:~1.1.3" ethereum-cryptography: "npm:^2.1.2" tweetnacl: "npm:^1.0.3" - checksum: 10/5de92bc59df31bcf417ecbdfd2b47f15c21b29454f45108513c55d9c005b7cb51373e9d254bd97533603ab7c7758fdf8fc5159612f366b05f92ebe5beb6d75d8 + checksum: 10/32b284fc8c3229e3741b1c21f44ca3f55c2215ef8ad700775cd9501bbaab56a4e861827bef24ed263734d28c899eb3b34a9646e9d21ec3fce12204b7eb58bfed languageName: node linkType: hard @@ -5626,14 +5636,14 @@ __metadata: languageName: node linkType: hard -"@metamask/json-rpc-engine@npm:^10.0.0, @metamask/json-rpc-engine@npm:^10.0.1": - version: 10.0.1 - resolution: "@metamask/json-rpc-engine@npm:10.0.1" +"@metamask/json-rpc-engine@npm:^10.0.0, @metamask/json-rpc-engine@npm:^10.0.1, @metamask/json-rpc-engine@npm:^10.0.2": + version: 10.0.2 + resolution: "@metamask/json-rpc-engine@npm:10.0.2" dependencies: - "@metamask/rpc-errors": "npm:^7.0.1" + "@metamask/rpc-errors": "npm:^7.0.2" "@metamask/safe-event-emitter": "npm:^3.0.0" - "@metamask/utils": "npm:^10.0.0" - checksum: 10/15a8eeab9af39b9ed87311da728e81169484ace733a8ef9fc469bd887654e37afa19f9e5228246dc80daad3fbf9b16067e73b2969d37d44acf5bc6ffa2c70082 + "@metamask/utils": "npm:^11.0.1" + checksum: 10/479e4c36ee10ecaa9b26bf8aaea375f7dbe68b5379fabc0f78ac087e310d0040b0e7a2d55eccebd820089404a2170f498c4e2b82eb7f0d34c5becbd811340d49 languageName: node linkType: hard @@ -6158,13 +6168,13 @@ __metadata: languageName: node linkType: hard -"@metamask/rpc-errors@npm:^7.0.0, @metamask/rpc-errors@npm:^7.0.1": - version: 7.0.1 - resolution: "@metamask/rpc-errors@npm:7.0.1" +"@metamask/rpc-errors@npm:^7.0.0, @metamask/rpc-errors@npm:^7.0.1, @metamask/rpc-errors@npm:^7.0.2": + version: 7.0.2 + resolution: "@metamask/rpc-errors@npm:7.0.2" dependencies: - "@metamask/utils": "npm:^10.0.0" + "@metamask/utils": "npm:^11.0.1" fast-safe-stringify: "npm:^2.0.6" - checksum: 10/819708b4a7d9695ee67fd867d8f94bb5a273b479a242b17bd53c83d1fceec421fc42928f0bb340f4f138ec803dd82ec9659ce7b09a86aedad6a81d5a39ec5c35 + checksum: 10/daf77a48b3f970585ef1f2efe3383d620fd4bffb550e8c6378b04a052f6948724a0b7e8a3e45b8b73298c70c4b9594b71fe0272664ea99620fe36e23443f8545 languageName: node linkType: hard @@ -6513,6 +6523,23 @@ __metadata: languageName: node linkType: hard +"@metamask/utils@npm:^11.0.1": + version: 11.0.1 + resolution: "@metamask/utils@npm:11.0.1" + dependencies: + "@ethereumjs/tx": "npm:^4.2.0" + "@metamask/superstruct": "npm:^3.1.0" + "@noble/hashes": "npm:^1.3.1" + "@scure/base": "npm:^1.1.3" + "@types/debug": "npm:^4.1.7" + debug: "npm:^4.3.4" + pony-cause: "npm:^2.1.10" + semver: "npm:^7.5.4" + uuid: "npm:^9.0.1" + checksum: 10/3949d16c8021bfb5f70e3b1c99f097ffaf43158116734197b039b32be6aabecb12178deb62c0b182e45295b0865618636324020059821c5b053029d8bdc90d70 + languageName: node + linkType: hard + "@metamask/utils@npm:^8.1.0, @metamask/utils@npm:^8.2.0, @metamask/utils@npm:^8.3.0": version: 8.5.0 resolution: "@metamask/utils@npm:8.5.0" @@ -26597,7 +26624,7 @@ __metadata: "@metamask/eslint-config-typescript": "npm:^9.0.1" "@metamask/eslint-plugin-design-tokens": "npm:^1.1.0" "@metamask/eth-json-rpc-filters": "npm:^9.0.0" - "@metamask/eth-json-rpc-middleware": "npm:^15.0.1" + "@metamask/eth-json-rpc-middleware": "npm:^15.1.2" "@metamask/eth-json-rpc-provider": "npm:^4.1.6" "@metamask/eth-ledger-bridge-keyring": "npm:^5.0.1" "@metamask/eth-query": "npm:^4.0.0"