-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass excludedPermissions
to SnapController
#17321
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
4261e1e
to
64a977a
Compare
ee0312f
to
548ad1e
Compare
Builds ready [548ad1e]
Page Load Metrics (1294 ± 95 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
af52878
to
4d08d54
Compare
548ad1e
to
439a448
Compare
Builds ready [439a448]
Page Load Metrics (1372 ± 97 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
439a448
to
88acbf7
Compare
Builds ready [d15007e]
Page Load Metrics (1287 ± 121 ms)
Bundle size diffs
|
Builds ready [413947d]
Page Load Metrics (1358 ± 109 ms)
Bundle size diffs
|
413947d
to
d87186e
Compare
Builds ready [d87186e]
Page Load Metrics (1310 ± 114 ms)
Bundle size diffs
|
d87186e
to
d1da271
Compare
Builds ready [d1da271]
Page Load Metrics (1230 ± 111 ms)
Bundle size diffs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excluded permissions should not be checked during run-time, but be completely removed during build time using code fencing.
I know this quite a bit of additional work, but this dramatically increases security. If we have a bug in logic, currently a bad actor could still find an exploit to run those permissions in stable.
If there's no code for those permissions at all in the extension, no way to run them in the first place.
As a suggestion, the easiest place to remove them during build time might be the RPC methods and PermissionController set-up, and the list here be used for informational purposes in console logs.
Builds ready [e5b1f9c]
Page Load Metrics (1212 ± 92 ms)
Bundle size diffs
|
Dismissing due to code fencing being implemented
0bda6dc
to
0de6123
Compare
Builds ready [0de6123]
Page Load Metrics (1388 ± 104 ms)
|
@GuillaumeRx @ritave should this be merged? |
Create a record of excluded permission/endowments with their associated error messages and pass it to
SnapController
. This also checks for the MetaMask version and updates the relevant methods using those excluded permissions.Fixes: MetaMask/snaps#1103 MetaMask/snaps#990