fix: unnecessary, unsafe base-controller patch#8808
Merged
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
aa25861 to
ddc1b8e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8808 +/- ##
=======================================
Coverage 41.60% 41.60%
=======================================
Files 1269 1269
Lines 30859 30859
Branches 3082 3082
=======================================
Hits 12840 12840
Misses 17243 17243
Partials 776 776 ☔ View full report in Codecov by Sentry. |
This comment was marked as outdated.
This comment was marked as outdated.
|
Contributor
|
Contributor
|
Ow I thought this patch was created because the TS linter was failing. LGTM! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Description
Removes a recently introduced base-controller patch that assigns the default argument
stringto theAllowedActionandAllowedEventgeneric parameters of the classRestrictedControllerMessenger.This patch was created in 81e2d18 as part of an intended fix for the breaking changes introduced by
@metamask/base-controllerv4.0.0. The fix was accomplished by a later commitd3a1dc7(#8607), but the now-redundant patch was never removed.This patch is too dangerous to keep as is, because it negates the allowlist security we have in place for our controller-messengers. This potentially enables any messenger to access any external action or event without restrictions.
The CI run shows that removing this patch does not break anything. This is because it's not actually affecting the code in any way (for now).
TL;DR The patch is not only safe to remove -- it's unsafe not to remove.
Related issues
getRestrictedinfers the wrong types when it has no allowed actions/events core#3648. However, this issue is only relevant to theControllerMessenger.getRestrictedMessengermethod, and not to theRestrictedControllerMessengerclass that is altered in the patch.Manual testing steps
Screenshots/Recordings
Pre-merge author checklist
Pre-merge reviewer checklist