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 zero-address checks in constructors #61

Closed
code423n4 opened this issue Jul 7, 2021 · 2 comments
Closed

Missing zero-address checks in constructors #61

code423n4 opened this issue Jul 7, 2021 · 2 comments
Labels
1 (Low Risk) bug Something isn't working duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Handle

0xRajeev

Vulnerability details

Impact

Checking addresses against zero-address during initialization or during setting is a security best-practice. However, such checks are missing in address variable initializations of some constructors.

Impact: Allowing zero-addresses will lead to contract reverts and force redeployments if there are no setters for such address variables.

Proof of Concept

https://github.com/code-423n4/2021-06-gro/blob/091660467fc8d13741f8aafcec80f1e8cf129a33/contracts/common/FixedContracts.sol#L17-L20

https://github.com/code-423n4/2021-06-gro/blob/091660467fc8d13741f8aafcec80f1e8cf129a33/contracts/common/FixedContracts.sol#L63-L66

https://github.com/code-423n4/2021-06-gro/blob/091660467fc8d13741f8aafcec80f1e8cf129a33/contracts/common/FixedContracts.sol#L82-L86

https://github.com/code-423n4/2021-06-gro/blob/091660467fc8d13741f8aafcec80f1e8cf129a33/contracts/vaults/BaseVaultAdaptor.sol#L77-L78

https://github.com/code-423n4/2021-06-gro/blob/091660467fc8d13741f8aafcec80f1e8cf129a33/contracts/pools/LifeGuard3Pool.sol#L67-L69

Tools Used

Manual Analysis

Recommended Mitigation Steps

Add zero-address checks for all initializations/setters of all address state variables.

@code423n4 code423n4 added 1 (Low Risk) bug Something isn't working labels Jul 7, 2021
code423n4 added a commit that referenced this issue Jul 7, 2021
@kitty-the-kat kitty-the-kat added the duplicate This issue or pull request already exists label Jul 14, 2021
@flabble-gro
Copy link
Collaborator

Duplicate of #90

@flabble-gro flabble-gro marked this as a duplicate of #90 Jul 14, 2021
@ghoul-sol ghoul-sol reopened this Jul 25, 2021
@ghoul-sol
Copy link
Collaborator

Duplicate of #90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 (Low Risk) bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants