From 52b92fbe40e221c53e1c93a2e998c65833c2334d Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 12 Jul 2017 13:09:20 -0700 Subject: Add first version of phishing site warning Links to my own blacklist for now, since I added a package.json for easy importing. We can point at the main 408H repository once this is merged: https://github.com/409H/EtherAddressLookup/pull/24 Redirects detected phishing sites [here](https://metamask.io/phishing.html). --- app/manifest.json | 6 ++++++ app/scripts/blacklister.js | 13 +++++++++++++ gulpfile.js | 1 + package.json | 1 + 4 files changed, 21 insertions(+) create mode 100644 app/scripts/blacklister.js diff --git a/app/manifest.json b/app/manifest.json index f3a1ebeff..ac6364059 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -52,6 +52,12 @@ ], "run_at": "document_start", "all_frames": true + }, + { + "run_at": "document_end", + "matches": ["http://*/*", "https://*/*"], + "js": ["scripts/blacklister.js"], + "css": ["css/blacklister.css"] } ], "permissions": [ diff --git a/app/scripts/blacklister.js b/app/scripts/blacklister.js new file mode 100644 index 000000000..a45265a75 --- /dev/null +++ b/app/scripts/blacklister.js @@ -0,0 +1,13 @@ +const blacklistedDomains = require('etheraddresslookup/blacklists/domains.json') + +function detectBlacklistedDomain() { + var strCurrentTab = window.location.hostname + if (blacklistedDomains && blacklistedDomains.includes(strCurrentTab)) { + window.location.href = 'https://metamask.io/phishing.html' + } +} + +window.addEventListener('load', function() { + detectBlacklistedDomain() +}) + diff --git a/gulpfile.js b/gulpfile.js index cc723704a..53de7a7d9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -172,6 +172,7 @@ gulp.task('default', ['lint'], function () { const jsFiles = [ 'inpage', 'contentscript', + 'blacklister', 'background', 'popup', ] diff --git a/package.json b/package.json index 10b175975..87312b8d1 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "eth-sig-util": "^1.1.1", "eth-simple-keyring": "^1.1.1", "eth-token-tracker": "^1.1.2", + "etheraddresslookup": "github:flyswatter/EtherAddressLookup#AddPackageJson", "ethereumjs-tx": "^1.3.0", "ethereumjs-util": "ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9", "ethereumjs-wallet": "^0.6.0", -- cgit v1.2.3 From 2c5b9da06a9b6e6455361136390784e3e774b5aa Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 12 Jul 2017 13:14:18 -0700 Subject: Bump changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb3fcfb83..02bebbb4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Current Master +- Now detects and blocks known phishing sites. - No longer validate nonce client-side in retry loop. - Fix bug where insufficient balance error was sometimes shown on successful transactions. -- cgit v1.2.3 From 0079126b7d46f0e20592117563e543531b96c36e Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 12 Jul 2017 14:33:03 -0700 Subject: Point blacklist at main repository --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 87312b8d1..54addd51c 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "eth-sig-util": "^1.1.1", "eth-simple-keyring": "^1.1.1", "eth-token-tracker": "^1.1.2", - "etheraddresslookup": "github:flyswatter/EtherAddressLookup#AddPackageJson", + "etheraddresslookup": "github:407H/EtherAddressLookup", "ethereumjs-tx": "^1.3.0", "ethereumjs-util": "ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9", "ethereumjs-wallet": "^0.6.0", -- cgit v1.2.3 From ed272dcbc082ebf9abbd7f17da1386163013c023 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 12 Jul 2017 15:09:01 -0700 Subject: Bump node version --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 1f018ac24..66eed17d7 100644 --- a/circle.yml +++ b/circle.yml @@ -1,6 +1,6 @@ machine: node: - version: 8.0.0 + version: 8.1.4 dependencies: pre: - "npm i -g testem" -- cgit v1.2.3 From aec813eace6db96984ccbb29d8b98d60097b22e2 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 12 Jul 2017 15:15:19 -0700 Subject: Correct github link --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 54addd51c..16f567dd2 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "eth-sig-util": "^1.1.1", "eth-simple-keyring": "^1.1.1", "eth-token-tracker": "^1.1.2", - "etheraddresslookup": "github:407H/EtherAddressLookup", + "etheraddresslookup": "github:409H/EtherAddressLookup", "ethereumjs-tx": "^1.3.0", "ethereumjs-util": "ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9", "ethereumjs-wallet": "^0.6.0", -- cgit v1.2.3 From 76a2a59ec54cb20cd482adf724815100916d5d3e Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 12 Jul 2017 15:24:59 -0700 Subject: Refresh blacklist before dist --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 16f567dd2..a1b1afae1 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "start": "npm run dev", "dev": "gulp dev --debug", "disc": "gulp disc --debug", - "dist": "npm install && gulp dist", + "dist": "rm -rf node_modules/etheraddresslookup && npm install && gulp dist", "test": "npm run lint && npm run test-unit && npm run test-integration", "test-unit": "METAMASK_ENV=test mocha --require test/helper.js --recursive \"test/unit/**/*.js\"", "test-integration": "npm run buildMock && npm run buildCiUnits && testem ci -P 2", -- cgit v1.2.3