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

Missing check for contract existence #55

Open
code423n4 opened this issue Aug 14, 2021 · 2 comments
Open

Missing check for contract existence #55

code423n4 opened this issue Aug 14, 2021 · 2 comments

Comments

@code423n4
Copy link
Contributor

Handle

0xRajeev

Vulnerability details

Impact

Low-level call returns success even if the contract is non-existent. This requires a contract existence check before making the low-level call.

Proof of Concept

https://github.com/code-423n4/2021-08-yield/blob/4dc46470e616dd0cbd9db9b4742e36c4d809e02c/contracts/utils/TimeLock.sol#L93

See: “The low-level functions call, delegatecall and staticcall return true as their first return value if the account called is non-existent, as part of the design of the EVM. Account existence must be checked prior to calling if needed.” from https://docs.soliditylang.org/en/v0.8.7/control-structures.html#error-handling-assert-require-revert-and-exceptions

Tools Used

Manual Analysis

Recommended Mitigation Steps

Check for target contract existence before call.

@code423n4 code423n4 added 1 (Low Risk) bug Something isn't working labels Aug 14, 2021
code423n4 added a commit that referenced this issue Aug 14, 2021
@alcueca
Copy link
Collaborator

alcueca commented Aug 15, 2021

Mmm, we do this in several other places in the codebase, as well as others do in earlier implementations. Will fix.

@alcueca
Copy link
Collaborator

alcueca commented Aug 16, 2021

Fix

@alcueca alcueca removed the Router label Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants