You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently some function (addToken and depositETH) in FluidexDemo contract has induced a "origin" parameter for being called from delegator contract. When called inside the delegator contract, the msg.sender of delegator contract it passed and being considered as the "original caller" of such an action. Such a practice may become problematic because:
The method which accepts origin argument has no ability to check if it was passed by expected: in case a malicious contract or address has been assigned with delegator role, they can forge any address which can pass the privilege checking of origin argument inside these methods.
The msg.sender is not the real tx caller if the delegator contract is called from another contract or proxy. In this case, the privilege checking is failed even a user with required privilege really call them.
There is tx.origin in solidity which indicate the sender of the transaction for the full calling chain. Maybe we should use the variant rather an additional "origin" parameter?
The text was updated successfully, but these errors were encountered:
Currently some function (addToken and depositETH) in FluidexDemo contract has induced a "origin" parameter for being called from delegator contract. When called inside the delegator contract, the msg.sender of delegator contract it passed and being considered as the "original caller" of such an action. Such a practice may become problematic because:
The method which accepts origin argument has no ability to check if it was passed by expected: in case a malicious contract or address has been assigned with delegator role, they can forge any address which can pass the privilege checking of origin argument inside these methods.
The msg.sender is not the real tx caller if the delegator contract is called from another contract or proxy. In this case, the privilege checking is failed even a user with required privilege really call them.
There is tx.origin in solidity which indicate the sender of the transaction for the full calling chain. Maybe we should use the variant rather an additional "origin" parameter?
The text was updated successfully, but these errors were encountered: