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

Using “origin" parameter may be a vulnerability #39

Open
noel2004 opened this issue Nov 18, 2021 · 0 comments
Open

Using “origin" parameter may be a vulnerability #39

noel2004 opened this issue Nov 18, 2021 · 0 comments

Comments

@noel2004
Copy link
Member

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:

  1. 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.

  2. 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?

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

No branches or pull requests

1 participant