-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat(multicall): prevent double initiation #284
Conversation
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.
I don't find any use case to having embedded multicalls, so I'm in favor of this
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.
So after a callback you can't anything than just one action?
Yes you are right I didn't think about it. Morpho callbacks don't work anymore (as they call multicall), that's a problem |
Why do you say so? As you can see, the test suite passes: yes callbacks do execute the multicall, but does not execute the external multicall function, only the internal one I have highlighted this in the issue |
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.
Approving but putting this PR on hold
I changed the base FYI |
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.
I think we're missing those 2 things to fix the issue:
-
Unless there is a very specific use case, Morpho should not allow the initiator to re-enter a recursive multicall transaction (that could end up anyway to revert as soon as the second one exits the multicall and the following actions are executed with initiator = address(0)).
-
Morpho should anyway document all these possible worst-case scenarios when the original caller executes multicall operations that interact with arbitrary contracts that could re-enter in a malicious way the Bundler flow.
taken from https://github.com/cantinasec/review-morpho-blue-1/issues/64
For 1. I'm not sure how to prevent in the general while still allowing to use callbacks on Blue.
1 is actually specifically addressed in this PR Callbacks don't re-enter multicall but use the internal I need to add comments to specify that indeed, some addresses can re-enter the bundler flow in a malicious way |
But the example of the |
6a2a0ef
to
828405a
Compare
828405a
to
28fdcfb
Compare
Not sure you read it @Rubilmax |
Indeed, I missed it. What do you want me to do about the possible re-entrancy in The goal of this PR is to prevent entering |
Agree, approving! |
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, but it does not close https://github.com/cantinasec/review-morpho-blue-1/issues/64 as the description suggests
initiator
value #282