Wrong value of MONTH_IN_SECONDS could make it impossible to recover NFT in 7 years #314
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-273
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2022-12-forgeries/blob/fc271cf20c05ce857d967728edfb368c58881d85/src/VRFNFTRandomDraw.sol#L33
Vulnerability details
Impact
Constant
MONTH_IN_SECONDS
has incorrect value. Instead of 1 month, it has the value of 7 months.This constant is used to check some settings in function
initialize()
As we can see, the last check make sure
recoverTimelock
cannot be longer than 1 year, but becauseMONTH_IN_SECONDS
, value ofrecoverTimelock
could be mistakenly set to 7 years.Proof of Concept
https://github.com/code-423n4/2022-12-forgeries/blob/fc271cf20c05ce857d967728edfb368c58881d85/src/VRFNFTRandomDraw.sol#L28-L35
Value of
MONTH_IN_SECONDS
should be3600 * 24 * 30
Tools Used
Manual Review
Recommended Mitigation Steps
Correcting the value of
MONTH_IN_SECONDS
to(3600 * 24 * 30)
The text was updated successfully, but these errors were encountered: