sherlock-audit / 2023-12-dodo-judging

5 stars 4 forks source link

bareli - Input Validation #26

Closed sherlock-admin2 closed 8 months ago

sherlock-admin2 commented 8 months ago

bareli

medium

Input Validation

Summary

Data Validation: The contract should validate input data to prevent setting incorrect or malicious values.

Vulnerability Detail

function init(address owner, address pool, uint256 maxInterval) external { initOwner(owner); POOL = pool; state.heartBeat.maxInterval = maxInterval; }

Impact

POOL, state.heartBeat can be initialize to 0.

Code Snippet

https://github.com/sherlock-audit/2023-12-dodo/blob/main/dodo-v3/contracts/DODOV3MM/D3Pool/D3Maker.sol#L29

Tool used

Manual Review

Recommendation

use require statement

nevillehuang commented 8 months ago

Invalid, admin input error, deployer trusted to set appropriate parameters that is not zero.