Merge pull request #1768 from MetaMask/AddBlacklist

Add first version of phishing site warning
feature/default_network_editable
kumavis 7 years ago committed by GitHub
commit f82f8a9fa4
  1. 1
      CHANGELOG.md
  2. 6
      app/manifest.json
  3. 13
      app/scripts/blacklister.js
  4. 2
      circle.yml
  5. 1
      gulpfile.js
  6. 3
      package.json

@ -2,6 +2,7 @@
## Current Master ## Current Master
- Now detects and blocks known phishing sites.
- No longer validate nonce client-side in retry loop. - No longer validate nonce client-side in retry loop.
- Fix bug where insufficient balance error was sometimes shown on successful transactions. - Fix bug where insufficient balance error was sometimes shown on successful transactions.

@ -52,6 +52,12 @@
], ],
"run_at": "document_start", "run_at": "document_start",
"all_frames": true "all_frames": true
},
{
"run_at": "document_end",
"matches": ["http://*/*", "https://*/*"],
"js": ["scripts/blacklister.js"],
"css": ["css/blacklister.css"]
} }
], ],
"permissions": [ "permissions": [

@ -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()
})

@ -1,6 +1,6 @@
machine: machine:
node: node:
version: 8.0.0 version: 8.1.4
dependencies: dependencies:
pre: pre:
- "npm i -g testem" - "npm i -g testem"

@ -172,6 +172,7 @@ gulp.task('default', ['lint'], function () {
const jsFiles = [ const jsFiles = [
'inpage', 'inpage',
'contentscript', 'contentscript',
'blacklister',
'background', 'background',
'popup', 'popup',
] ]

@ -7,7 +7,7 @@
"start": "npm run dev", "start": "npm run dev",
"dev": "gulp dev --debug", "dev": "gulp dev --debug",
"disc": "gulp disc --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": "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-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", "test-integration": "npm run buildMock && npm run buildCiUnits && testem ci -P 2",
@ -68,6 +68,7 @@
"eth-sig-util": "^1.1.1", "eth-sig-util": "^1.1.1",
"eth-simple-keyring": "^1.1.1", "eth-simple-keyring": "^1.1.1",
"eth-token-tracker": "^1.1.2", "eth-token-tracker": "^1.1.2",
"etheraddresslookup": "github:409H/EtherAddressLookup",
"ethereumjs-tx": "^1.3.0", "ethereumjs-tx": "^1.3.0",
"ethereumjs-util": "ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9", "ethereumjs-util": "ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9",
"ethereumjs-wallet": "^0.6.0", "ethereumjs-wallet": "^0.6.0",

Loading…
Cancel
Save