From 7ca402147df6064c389912ef8136235a9eb2ebc4 Mon Sep 17 00:00:00 2001 From: Kelvin Tan Date: Wed, 25 Jul 2018 23:37:04 +0800 Subject: add phishing html page, and redirect to bundled page in-window --- app/images/ethereum-metamask-chrome.png | Bin 0 -> 60022 bytes app/manifest.json | 3 +- app/phishing.html | 60 ++++++++++++++++++++++++++++++++ app/scripts/contentscript.js | 5 +-- package-lock.json | 55 ++++++++++------------------- 5 files changed, 84 insertions(+), 39 deletions(-) create mode 100644 app/images/ethereum-metamask-chrome.png create mode 100644 app/phishing.html diff --git a/app/images/ethereum-metamask-chrome.png b/app/images/ethereum-metamask-chrome.png new file mode 100644 index 00000000..0b886bab Binary files /dev/null and b/app/images/ethereum-metamask-chrome.png differ diff --git a/app/manifest.json b/app/manifest.json index 52256c5b..ed328f19 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -67,7 +67,8 @@ "notifications" ], "web_accessible_resources": [ - "inpage.js" + "inpage.js", + "phishing.html" ], "externally_connectable": { "matches": [ diff --git a/app/phishing.html b/app/phishing.html new file mode 100644 index 00000000..86f2985c --- /dev/null +++ b/app/phishing.html @@ -0,0 +1,60 @@ + + + + + + Phishing Warning + + + + + + + + +
+ + +

ATTENTION

+

MetaMask believes this domain to have malicious intent and has prevented you from interacting with it.

+

This is because the site tested positive on the Ethereum Phishing Detector.

+

You can turn MetaMask off to interact with this site, but it's advised not to.

+

If you think this domain is incorrectly flagged, please file an issue.

+ +
+ + \ No newline at end of file diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index 7b7114c3..b7496f31 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -197,6 +197,7 @@ function blacklistedDomainCheck () { * Redirects the current page to a phishing information page */ function redirectToPhishingWarning () { - console.log('MetaMask - redirecting to phishing warning') - window.location.href = 'https://metamask.io/phishing.html' + console.log('MetaMask - routing to Phishing Warning component') + let extensionURL = extension.runtime.getURL('phishing.html') + window.location.href = extensionURL } diff --git a/package-lock.json b/package-lock.json index 1a2897a9..88b428d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2,7 +2,6 @@ "name": "metamask-crx", "version": "0.0.0", "lockfileVersion": 1, - "requires": true, "dependencies": { "@babel/code-frame": { "version": "7.0.0-beta.31", @@ -1623,15 +1622,6 @@ "@types/react": "*" } }, - "JSONStream": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", - "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - } - }, "abab": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", @@ -8359,8 +8349,7 @@ } }, "eth-contract-metadata": { - "version": "github:MetaMask/eth-contract-metadata#2da362052a312dc6c72a7eec116abf6284664f50", - "from": "github:MetaMask/eth-contract-metadata#master" + "version": "github:MetaMask/eth-contract-metadata#966a891dd9c79b873fd8968a0155b067ca630502" }, "eth-ens-namehash": { "version": "2.0.8", @@ -9209,15 +9198,7 @@ } }, "ethereumjs-util": { - "version": "github:ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9", - "from": "github:ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9", - "requires": { - "bn.js": "^4.8.0", - "create-hash": "^1.1.2", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "secp256k1": "^3.0.1" - } + "version": "github:ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9" }, "ethereumjs-vm": { "version": "2.3.2", @@ -12998,13 +12979,6 @@ }, "gulp": { "version": "github:gulpjs/gulp#71c094a51c7972d26f557899ddecab0210ef3776", - "from": "github:gulpjs/gulp#4.0", - "requires": { - "glob-watcher": "^4.0.0", - "gulp-cli": "^2.0.0", - "undertaker": "^1.0.0", - "vinyl-fs": "^3.0.0" - }, "dependencies": { "gulp-cli": { "version": "2.0.1", @@ -16966,6 +16940,15 @@ "dev": true, "optional": true }, + "JSONStream": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", + "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -28853,6 +28836,14 @@ "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, "string-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz", @@ -28909,14 +28900,6 @@ "function-bind": "^1.0.2" } }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, "stringify-object": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.2.2.tgz", -- cgit