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 and core configuration variables checks in most contracts #78

Closed
code423n4 opened this issue Jan 28, 2022 · 1 comment
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Handle

hyh

Vulnerability details

Impact

Being instantiated with a wrong configuration, the contracts are inoperable.

As in this case the variable list is big enough, a wrong value can go unnoticed and cause various malfunctions down the road.

Proof of Concept

The following initialize/constructor functions miss configuration variables checks.

OpenLevV1:

https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/OpenLevV1.sol#L46

ControllerV1:

https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/ControllerV1.sol#L33

XOLE:

https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/XOLE.sol#L40

FarmingPools:

https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/farming/FarmingPools.sol#L46

XOLEDelegator :

https://github.com/code-423n4/2022-01-openleverage/blob/main/openleverage-contracts/contracts/XOLEDelegator.sol#L17

Recommended Mitigation Steps

Add checks for zero addresses and control the values supplied for all core configuration variables

@code423n4 code423n4 added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working labels Jan 28, 2022
code423n4 added a commit that referenced this issue Jan 28, 2022
@ColaM12 ColaM12 added the duplicate This issue or pull request already exists label Jan 29, 2022
@ColaM12
Copy link
Collaborator

ColaM12 commented Jan 29, 2022

Duplicate to #57

@ColaM12 ColaM12 closed this as completed Jan 29, 2022
@0xleastwood 0xleastwood added 0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation and removed 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments labels Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants