Skip to content
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

[Improvement] Remove permitted call hooks and injected hooks #22

Closed
jaypaik opened this issue Dec 18, 2023 · 1 comment · Fixed by erc6900/reference-implementation#20

Comments

@jaypaik
Copy link
Contributor

jaypaik commented Dec 18, 2023

Permitted call hooks are execution hooks that run in an executeFromPlugin or executeFromPluginExternal context that are tied to an execution function and the calling plugin. It was originally introduced to enable running of different hooks based on the calling plugin when plugins perform actions via the account. Later, its use expanded to injected hooks provided during plugin installation, which protect the account at the same time the new plugin is installed, as opposed to installing the plugin first and then applying protective hooks to secure the account later (which introduces a window for potential exploits if the installed plugin is malicious).

Permitted call hooks add an additional component to the spec, and its use with injected hooks increases complexity in the plugin install/uninstall process. This proposal seeks to remove permitted call hooks.

  • Enabling running of different hooks based on the calling plugin can already be done via plain execution hooks, by having the hook-providing plugin implement the switching logic within its hook function. The minor downside here is that these hooks will still run (albeit early return) for non-matching calls.
  • To replace the injected hooks behavior, one can install a plugin that preemptively applies hooks to execution functions that will be installed later. This way, the protections are already in place by the time the relevant plugin is installed. The tradeoff here is that this is a bit less flexible since the hook-providing plugin must know ahead of time which execution functions to apply hooks to (shared via its plugin manifest), instead of the user being able to configure this at time of installation.
@jaypaik
Copy link
Contributor Author

jaypaik commented Dec 18, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants