-
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
⚡️ Adding msg.sender separation for factory calls #64
Conversation
src/core/ModuleManager.sol
Outdated
@@ -34,6 +60,12 @@ abstract contract ModuleManager is IRegistry, ResolverManager { | |||
|
|||
mapping(address moduleAddress => ModuleRecord moduleRecord) internal $moduleAddrToRecords; | |||
|
|||
FactoryTrampolin private immutable FACTORY_TRAMPOLIN; |
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.
should I make this public? could be helpful if specialized factories want to do access control for the trampolin. would be better devex?!
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.
yeah that makes sense imo
de456f8
to
4af3776
Compare
src/core/ModuleManager.sol
Outdated
moduleAddress = abi.decode(returnData, (address)); | ||
// Call the factory via the trampolin contract. This will make sure that there is msg.sender separation | ||
// Making "raw" calls to user supplied addresses could create security issues. | ||
moduleAddress = FACTORY_TRAMPOLIN.deployViaFactory{ value: msg.value }({ factory: factory, callOnFactory: callOnFactory }); |
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.
TODO: should write test that msg.value is correctly passed through
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.
fix spelling
Co-authored-by: Konrad <kopp.konrad@gmail.com>
Co-authored-by: Konrad <kopp.konrad@gmail.com>
Co-authored-by: Konrad <kopp.konrad@gmail.com>
Co-authored-by: Konrad <kopp.konrad@gmail.com>
Co-authored-by: Konrad <kopp.konrad@gmail.com>
Co-authored-by: Konrad <kopp.konrad@gmail.com>
Co-authored-by: Konrad <kopp.konrad@gmail.com>
I don't think this is a vulnerability outright. But I could imagine that some business logic in resolvers in the future could be triggered by this.