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 validation #190

Closed
code423n4 opened this issue Feb 2, 2022 · 1 comment
Closed

Missing zero address validation #190

code423n4 opened this issue Feb 2, 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

Dravee

Vulnerability details

This is actually an automated finding from Slither.

This output might be informational due to design choices (gas savings for non-zero address checks).

I checked and there don't seem to be false positives.

Slither's output

OLEToken.constructor(address,address,string,string)._admin (gov/OLEToken.sol#41) lacks a zero-check on :
		- admin = _admin (gov/OLEToken.sol#42)
OpenLevDelegator.constructor(address,address,address[],address,address,uint8[],address,address).implementation_ (OpenLevDelegator.sol#22) lacks a zero-check on :
		- implementation = implementation_ (OpenLevDelegator.sol#34)
OpenLevDelegator.constructor(address,address,address[],address,address,uint8[],address,address)._admin (OpenLevDelegator.sol#21) lacks a zero-check on :
		- admin = _admin (OpenLevDelegator.sol#37)
OpenLevDelegator.setImplementation(address).implementation_ (OpenLevDelegator.sol#44) lacks a zero-check on :
		- implementation = implementation_ (OpenLevDelegator.sol#46)
OpenLevV1Lib.doTransferOut(address,IERC20,address,uint256).to (OpenLevV1Lib.sol#250) lacks a zero-check on :
		- address(to).transfer(amount) (OpenLevV1Lib.sol#253)
Timelock.constructor(address,uint256).admin_ (gov/Timelock.sol#32) lacks a zero-check on :
		- admin = admin_ (gov/Timelock.sol#36)
Timelock.setPendingAdmin(address).pendingAdmin_ (gov/Timelock.sol#67) lacks a zero-check on :
		- pendingAdmin = pendingAdmin_ (gov/Timelock.sol#74)
Timelock.executeTransaction(address,uint256,string,bytes,uint256).target (gov/Timelock.sol#117) lacks a zero-check on :
		- (success,returnData) = target.call{value: value}(callData) (gov/Timelock.sol#137)
ControllerV1.initialize(IERC20,address,address,address,address,DexAggregatorInterface,bytes)._xoleToken (ControllerV1.sol#35) lacks a zero-check on :
		- xoleToken = _xoleToken (ControllerV1.sol#44)
ControllerV1.initialize(IERC20,address,address,address,address,DexAggregatorInterface,bytes)._wETH (ControllerV1.sol#36) lacks a zero-check on :
		- wETH = _wETH (ControllerV1.sol#45)
ControllerV1.initialize(IERC20,address,address,address,address,DexAggregatorInterface,bytes)._lpoolImplementation (ControllerV1.sol#37) lacks a zero-check on :
		- lpoolImplementation = _lpoolImplementation (ControllerV1.sol#46)
ControllerV1.initialize(IERC20,address,address,address,address,DexAggregatorInterface,bytes)._openlev (ControllerV1.sol#38) lacks a zero-check on :
		- openLev = _openlev (ControllerV1.sol#47)
XOLE.setDev(address).newDev (XOLE.sol#172) lacks a zero-check on :
		- dev = newDev (XOLE.sol#173)
XOLE.delegateBySigs(address,uint256[],uint256[],uint8[],bytes32[],bytes32[]).delegatee (XOLE.sol#360) lacks a zero-check on :
		- (success) = address(this).call(abi.encodeWithSelector(XOLE(address(this)).delegateBySig.selector,delegatee,nonce[i],expiry[i],v[i],r[i],s[i])) (XOLE.sol#363-365)
XOLEDelegator.constructor(address,DexAggregatorInterface,uint256,address,address,address).implementation_ (XOLEDelegator.sol#23) lacks a zero-check on :
		- implementation = implementation_ (XOLEDelegator.sol#33)
XOLEDelegator.constructor(address,DexAggregatorInterface,uint256,address,address,address)._admin (XOLEDelegator.sol#22) lacks a zero-check on :
		- admin = _admin (XOLEDelegator.sol#36)
XOLEDelegator.setImplementation(address).implementation_ (XOLEDelegator.sol#43) lacks a zero-check on :
		- implementation = implementation_ (XOLEDelegator.sol#45)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#missing-zero-address-validation
@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 Feb 2, 2022
code423n4 added a commit that referenced this issue Feb 2, 2022
@ColaM12 ColaM12 added the duplicate This issue or pull request already exists label Feb 2, 2022
@ColaM12
Copy link
Collaborator

ColaM12 commented Feb 2, 2022

Duplicate to #57

@ColaM12 ColaM12 closed this as completed Feb 2, 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