From 617436662a8b5df2b5de648e99006efe21933e27 Mon Sep 17 00:00:00 2001
From: Boris Kubiak
Date: Wed, 5 Sep 2018 08:34:05 +0200
Subject: [PATCH] feat: Display a security alert
---
src/App.vue | 12 ++++++++++++
src/css/variables.sass | 2 +-
src/vue/Error.vue | 9 +++++++++
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/src/App.vue b/src/App.vue
index 51bc6d3..b648828 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -225,11 +225,23 @@
m.parentNode.insertBefore(o, m)
})(document, window, 'https://stats.vanity-eth.tk/tracker.js', 'fathom');
fathom('trackPageview');
+ },
+ checkLocation() {
+ try {
+ this.error = window.self !== window.top ? 'insecure_location' : this.error;
+ } catch (e) {
+ this.error = 'insecure_location'
+ }
+ const hostname = window.location.hostname;
+ if (hostname && ['localhost', '127.0.0.1', 'vanity-eth.tk'].indexOf(hostname) === -1) {
+ this.error = 'insecure_location';
+ }
}
},
created: function () {
this.addFavicon();
+ this.checkLocation();
this.countCores();
this.initWorkers();
this.initFathom();
diff --git a/src/css/variables.sass b/src/css/variables.sass
index 9e8e8d2..6871546 100644
--- a/src/css/variables.sass
+++ b/src/css/variables.sass
@@ -15,7 +15,7 @@ $bg-fallback: #09c4c5
$primary: #0cd3bc
$secondary: #46decc
-$error: #ff839a
+$error: #f55959
$shadow: 1px 5px 10px rgba(0, 0, 0, 0.15)
$shadow-big: 2px 10px 15px rgba(0, 0, 0, 0.15)
diff --git a/src/vue/Error.vue b/src/vue/Error.vue
index 0d1353c..2ed87e4 100644
--- a/src/vue/Error.vue
+++ b/src/vue/Error.vue
@@ -4,6 +4,14 @@
Your browser does not support multi-thread computation.
Please use a different browser.
+
+
+
Security alert
+
+ It seems like you are using Vanity-ETH from an unknown website, which could stole your private key.
+ To stay safe, use Vanity-ETH on
vanity-eth.tk, or download the latest
+ build here
here to use offline.
+
@@ -27,4 +35,5 @@
color: $text-opposite
a, a:visited, a:hover
text-decoration: underline
+ color: $text-opposite
\ No newline at end of file