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

Address.isContract() is not a reliable way of checking if the input is an EOA #40

Open
hats-bug-reporter bot opened this issue Jun 22, 2023 · 2 comments
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@hats-bug-reporter
Copy link

Github username: --
Submission hash (on-chain): 0x5224612aa1dbc3efd9856dd3081df2c4289d2c038ab2958c552958a3c1549563
Severity: high severity

Description:

Impact

Detailed description of the impact of this finding.

The expectation of the noContract is controlled using ! access control with Address.isContract, then because isContract() gets the size of the code length of the account in question by relying on extcodesize/address.code.length, this means that the restriction can be bypassed when deploying a smart contract through the smart contract's constructor call.

Recommendation

Modify the code to require(msg.sender == tx.origin);

@hats-bug-reporter hats-bug-reporter bot added the bug Something isn't working label Jun 22, 2023
@ksyao2002
Copy link

Thanks for the information. This is not a vulnerability, as c._curvePool can only be set by VMEX global admins. This check is more of a sanity check on the behalf of the VMEX team, and no funds are at risk. The restriction bypassing is impossible for contracts already deployed.

@ksyao2002 ksyao2002 added the invalid This doesn't seem right label Jun 22, 2023
@Nabeel-javaid
Copy link

Nabeel-javaid commented Jun 22, 2023

Thanks for the information. This is not a vulnerability, as c._curvePool can only be set by VMEX global admins. This check is more of a sanity check on the behalf of the VMEX team, and no funds are at risk. The restriction bypassing is impossible for contracts already deployed.

it is impossible for the contracts that is alr deployed, but not for the one that are in the process of deployment

also I do think that it should be atleast L or Med

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants