diff --git a/app/scripts/metamask-controller.test.js b/app/scripts/metamask-controller.test.js index d641699b9..2db150de3 100644 --- a/app/scripts/metamask-controller.test.js +++ b/app/scripts/metamask-controller.test.js @@ -177,6 +177,18 @@ const firstTimeState = { }, }, }, + PhishingController: { + phishingLists: [ + { + allowlist: [], + blocklist: ['test.metamask-phishing.io'], + fuzzylist: [], + tolerance: 0, + version: 0, + name: 'MetaMask', + }, + ], + }, }; const noop = () => undefined; @@ -205,7 +217,7 @@ describe('MetaMaskController', function () { eth_phishing_detect_config: { fuzzylist: [], allowlist: [], - blocklist: ['127.0.0.1'], + blocklist: ['test.metamask-phishing.io'], name: ListNames.MetaMask, }, phishfort_hotlist: { @@ -218,7 +230,11 @@ describe('MetaMaskController', function () { .reply( 200, JSON.stringify([ - { url: '127.0.0.1', targetList: 'blocklist', timestamp: 0 }, + { + url: 'test.metamask-phishing.io', + targetList: 'blocklist', + timestamp: 0, + }, ]), ); @@ -960,7 +976,7 @@ describe('MetaMaskController', function () { it('sets up phishing stream for untrusted communication', async function () { const phishingMessageSender = { - url: 'http://myethereumwalletntw.com', + url: 'http://test.metamask-phishing.io', tab: {}, }; diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 9b750dc06..defef7b1a 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -884,8 +884,8 @@ "setTimeout": true }, "packages": { + "@metamask/controller-utils>@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true, @@ -893,6 +893,19 @@ "ethjs>ethjs-unit": true } }, + "@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/key-tree>@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true, + "superstruct": true + } + }, "@metamask/controller-utils>@spruceid/siwe-parser": { "globals": { "console.error": true, @@ -1712,34 +1725,12 @@ "fetch": true }, "packages": { - "@metamask/phishing-controller>@metamask/base-controller": true, - "@metamask/phishing-controller>@metamask/controller-utils": true, + "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/phishing-warning>eth-phishing-detect": true, "punycode": true } }, - "@metamask/phishing-controller>@metamask/base-controller": { - "packages": { - "immer": true - } - }, - "@metamask/phishing-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true, - "ethereumjs-util": true, - "ethjs>ethjs-unit": true - } - }, "@metamask/phishing-warning>eth-phishing-detect": { "packages": { "eslint>optionator>fast-levenshtein": true diff --git a/lavamoat/browserify/desktop/policy.json b/lavamoat/browserify/desktop/policy.json index 75d7032be..43c731fcc 100644 --- a/lavamoat/browserify/desktop/policy.json +++ b/lavamoat/browserify/desktop/policy.json @@ -884,8 +884,8 @@ "setTimeout": true }, "packages": { + "@metamask/controller-utils>@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true, @@ -893,6 +893,19 @@ "ethjs>ethjs-unit": true } }, + "@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/key-tree>@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true, + "superstruct": true + } + }, "@metamask/controller-utils>@spruceid/siwe-parser": { "globals": { "console.error": true, @@ -1847,34 +1860,12 @@ "fetch": true }, "packages": { - "@metamask/phishing-controller>@metamask/base-controller": true, - "@metamask/phishing-controller>@metamask/controller-utils": true, + "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/phishing-warning>eth-phishing-detect": true, "punycode": true } }, - "@metamask/phishing-controller>@metamask/base-controller": { - "packages": { - "immer": true - } - }, - "@metamask/phishing-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true, - "ethereumjs-util": true, - "ethjs>ethjs-unit": true - } - }, "@metamask/phishing-warning>eth-phishing-detect": { "packages": { "eslint>optionator>fast-levenshtein": true diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 75d7032be..43c731fcc 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -884,8 +884,8 @@ "setTimeout": true }, "packages": { + "@metamask/controller-utils>@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true, @@ -893,6 +893,19 @@ "ethjs>ethjs-unit": true } }, + "@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/key-tree>@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true, + "superstruct": true + } + }, "@metamask/controller-utils>@spruceid/siwe-parser": { "globals": { "console.error": true, @@ -1847,34 +1860,12 @@ "fetch": true }, "packages": { - "@metamask/phishing-controller>@metamask/base-controller": true, - "@metamask/phishing-controller>@metamask/controller-utils": true, + "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/phishing-warning>eth-phishing-detect": true, "punycode": true } }, - "@metamask/phishing-controller>@metamask/base-controller": { - "packages": { - "immer": true - } - }, - "@metamask/phishing-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true, - "ethereumjs-util": true, - "ethjs>ethjs-unit": true - } - }, "@metamask/phishing-warning>eth-phishing-detect": { "packages": { "eslint>optionator>fast-levenshtein": true diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 9b750dc06..defef7b1a 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -884,8 +884,8 @@ "setTimeout": true }, "packages": { + "@metamask/controller-utils>@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true, @@ -893,6 +893,19 @@ "ethjs>ethjs-unit": true } }, + "@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/key-tree>@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true, + "superstruct": true + } + }, "@metamask/controller-utils>@spruceid/siwe-parser": { "globals": { "console.error": true, @@ -1712,34 +1725,12 @@ "fetch": true }, "packages": { - "@metamask/phishing-controller>@metamask/base-controller": true, - "@metamask/phishing-controller>@metamask/controller-utils": true, + "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/phishing-warning>eth-phishing-detect": true, "punycode": true } }, - "@metamask/phishing-controller>@metamask/base-controller": { - "packages": { - "immer": true - } - }, - "@metamask/phishing-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true, - "ethereumjs-util": true, - "ethjs>ethjs-unit": true - } - }, "@metamask/phishing-warning>eth-phishing-detect": { "packages": { "eslint>optionator>fast-levenshtein": true diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index 938c0d76e..41ecf2d75 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -1105,8 +1105,8 @@ "setTimeout": true }, "packages": { + "@metamask/controller-utils>@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true, @@ -1114,6 +1114,19 @@ "ethjs>ethjs-unit": true } }, + "@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/key-tree>@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true, + "superstruct": true + } + }, "@metamask/controller-utils>@spruceid/siwe-parser": { "globals": { "console.error": true, @@ -1933,34 +1946,12 @@ "fetch": true }, "packages": { - "@metamask/phishing-controller>@metamask/base-controller": true, - "@metamask/phishing-controller>@metamask/controller-utils": true, + "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/phishing-warning>eth-phishing-detect": true, "punycode": true } }, - "@metamask/phishing-controller>@metamask/base-controller": { - "packages": { - "immer": true - } - }, - "@metamask/phishing-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true, - "ethereumjs-util": true, - "ethjs>ethjs-unit": true - } - }, "@metamask/phishing-warning>eth-phishing-detect": { "packages": { "eslint>optionator>fast-levenshtein": true diff --git a/package.json b/package.json index 1b5a74ff5..93c082075 100644 --- a/package.json +++ b/package.json @@ -250,7 +250,7 @@ "@metamask/notification-controller": "^3.0.0", "@metamask/obs-store": "^8.1.0", "@metamask/permission-controller": "^4.0.0", - "@metamask/phishing-controller": "^4.0.0", + "@metamask/phishing-controller": "^6.0.0", "@metamask/post-message-stream": "^6.0.0", "@metamask/providers": "^11.1.0", "@metamask/rate-limit-controller": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index 144acb323..476f1f709 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3992,7 +3992,7 @@ __metadata: languageName: node linkType: hard -"@metamask/controller-utils@npm:^3.0.0, @metamask/controller-utils@npm:^3.1.0, @metamask/controller-utils@npm:^3.4.0": +"@metamask/controller-utils@npm:^3.0.0, @metamask/controller-utils@npm:^3.4.0": version: 3.4.0 resolution: "@metamask/controller-utils@npm:3.4.0" dependencies: @@ -4007,20 +4007,19 @@ __metadata: languageName: node linkType: hard -"@metamask/controller-utils@npm:^4.0.0, @metamask/controller-utils@npm:^4.0.1, @metamask/controller-utils@npm:^4.1.0, @metamask/controller-utils@npm:^4.2.0": - version: 4.2.0 - resolution: "@metamask/controller-utils@npm:4.2.0" +"@metamask/controller-utils@npm:^4.0.0, @metamask/controller-utils@npm:^4.0.1, @metamask/controller-utils@npm:^4.1.0, @metamask/controller-utils@npm:^4.2.0, @metamask/controller-utils@npm:^4.3.0": + version: 4.3.1 + resolution: "@metamask/controller-utils@npm:4.3.1" dependencies: - "@metamask/utils": ^5.0.2 + "@metamask/eth-query": ^3.0.1 + "@metamask/utils": ^6.2.0 "@spruceid/siwe-parser": 1.1.3 - babel-runtime: ^6.26.0 eth-ens-namehash: ^2.0.8 - eth-query: ^2.1.2 eth-rpc-errors: ^4.0.2 ethereumjs-util: ^7.0.10 ethjs-unit: ^0.1.6 fast-deep-equal: ^3.1.3 - checksum: e71779577c37038e6e605a43ef6b9c1af82e0b3887a72c01f48ae1e4e2005116fc9d09c8b690139478c04dd2929e227642c5fd80cfbc81814d667c415c714228 + checksum: 5bb471df560a12fba1b7fa147fe0332e06b527637c04facff1774b1279dd388b4cf1d74340469adb13551c08cc156f204d90e36599ad69b54716b11e5842b348 languageName: node linkType: hard @@ -4186,6 +4185,16 @@ __metadata: languageName: node linkType: hard +"@metamask/eth-query@npm:^3.0.1": + version: 3.0.1 + resolution: "@metamask/eth-query@npm:3.0.1" + dependencies: + json-rpc-random-id: ^1.0.0 + xtend: ^4.0.1 + checksum: b9a323dff67328eace7d54fc8b0bc4dd763bf15760870656cbd5aad5380d1ee4489fb5c59506290d5f77cf55e74e530ee97b52702a329f1090ec03a6158434b7 + languageName: node + linkType: hard + "@metamask/eth-sig-util@npm:5.0.2": version: 5.0.2 resolution: "@metamask/eth-sig-util@npm:5.0.2" @@ -4511,16 +4520,16 @@ __metadata: languageName: node linkType: hard -"@metamask/phishing-controller@npm:^4.0.0": - version: 4.0.0 - resolution: "@metamask/phishing-controller@npm:4.0.0" +"@metamask/phishing-controller@npm:^6.0.0": + version: 6.0.0 + resolution: "@metamask/phishing-controller@npm:6.0.0" dependencies: - "@metamask/base-controller": ^2.0.0 - "@metamask/controller-utils": ^3.1.0 + "@metamask/base-controller": ^3.2.0 + "@metamask/controller-utils": ^4.3.0 "@types/punycode": ^2.1.0 eth-phishing-detect: ^1.2.0 punycode: ^2.1.1 - checksum: 15de581f7bec21d75531167275c68d7bbeae7fdaad02268749ba0a71c4d3ccb53718d963d6583e90c337407f65b7fcc9a89eb76c6f731802c2668a8425d5df89 + checksum: 13a85865cef1515f6d0ee1cd02da37e5e6b98c493676e3a80195294725b717aa17651a0c24d2e841f790bbd22ae16911cc16bab7846da8266f4ee03007a17f4e languageName: node linkType: hard @@ -24504,7 +24513,7 @@ __metadata: "@metamask/notification-controller": ^3.0.0 "@metamask/obs-store": ^8.1.0 "@metamask/permission-controller": ^4.0.0 - "@metamask/phishing-controller": ^4.0.0 + "@metamask/phishing-controller": ^6.0.0 "@metamask/phishing-warning": ^2.1.0 "@metamask/post-message-stream": ^6.0.0 "@metamask/providers": ^11.1.0