-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: unnecessary, unsafe base-controller patch #8808
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.
Quality Gate passedIssues Measures |
Bitrise✅✅✅ Commit hash: e0d94c3 Note
|
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.
Looks good!
Ow I thought this patch was created because the TS linter was failing. LGTM! |
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.
LGTM
Description
Removes a recently introduced base-controller patch that assigns the default argument
string
to theAllowedAction
andAllowedEvent
generic parameters of the classRestrictedControllerMessenger
.This patch was created in 81e2d18 as part of an intended fix for the breaking changes introduced by
@metamask/base-controller
v4.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
getRestricted
infers the wrong types when it has no allowed actions/events core#3648. However, this issue is only relevant to theControllerMessenger.getRestrictedMessenger
method, and not to theRestrictedControllerMessenger
class that is altered in the patch.Manual testing steps
Screenshots/Recordings
Pre-merge author checklist
Pre-merge reviewer checklist