1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Lavamoat - protect all UI contexts (#14537)

* lavamoat - apply lavamoat protections to popup and notification

* build - enable lavamoat for home

* lavamoat - add missing ui overrides for react family

* deps/patches - patch zxcvbn for ses compat
This commit is contained in:
kumavis 2022-04-28 08:45:46 -10:00 committed by GitHub
parent 1624af2364
commit 66bd172980
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 64 additions and 3 deletions

View File

@ -473,21 +473,21 @@ function createFactoredBuild({
groupSet,
commonSet,
browserPlatforms,
useLavamoat: false,
useLavamoat: true,
});
renderHtmlFile({
htmlName: 'notification',
groupSet,
commonSet,
browserPlatforms,
useLavamoat: false,
useLavamoat: true,
});
renderHtmlFile({
htmlName: 'home',
groupSet,
commonSet,
browserPlatforms,
useLavamoat: false,
useLavamoat: true,
});
break;
}

View File

@ -55,6 +55,22 @@
"globals": {
"localStorage": true
}
},
"react-dom": {
"globals": {
"HTMLIFrameElement": true
}
},
"react-devtools": {
"packages": {
"react-devtools-core": true
}
},
"react-devtools-core": {
"globals": {
"setTimeout": true,
"WebSocket": true
}
}
}
}

View File

@ -50,6 +50,22 @@
"globals": {
"localStorage": true
}
},
"react-dom": {
"globals": {
"HTMLIFrameElement": true
}
},
"react-devtools": {
"packages": {
"react-devtools-core": true
}
},
"react-devtools-core": {
"globals": {
"setTimeout": true,
"WebSocket": true
}
}
}
}

View File

@ -55,6 +55,22 @@
"globals": {
"localStorage": true
}
},
"react-dom": {
"globals": {
"HTMLIFrameElement": true
}
},
"react-devtools": {
"packages": {
"react-devtools-core": true
}
},
"react-devtools-core": {
"globals": {
"setTimeout": true,
"WebSocket": true
}
}
}
}

View File

@ -0,0 +1,13 @@
diff --git a/node_modules/zxcvbn/lib/matching.js b/node_modules/zxcvbn/lib/matching.js
index 3940bad..748da8b 100644
--- a/node_modules/zxcvbn/lib/matching.js
+++ b/node_modules/zxcvbn/lib/matching.js
@@ -13,7 +13,7 @@ build_ranked_dict = function(ordered_list) {
i = 1;
for (o = 0, len1 = ordered_list.length; o < len1; o++) {
word = ordered_list[o];
- result[word] = i;
+ Reflect.defineProperty(result, word, { value: i, configurable: true, enumerable: true, writable: true });
i += 1;
}
return result;