Closed code423n4 closed 2 years ago
https://github.com/code-423n4/2022-04-jpegd/blob/e72861a9ccb707ced9015166fbded5c97c6991b6/contracts/vaults/NFTVault.sol#L347-L354
function setPendingNFTValueETH(uint256 _nftIndex, uint256 _amountETH) external validNFTIndex(_nftIndex) onlyRole(DAO_ROLE) { pendingNFTValueETH[_nftIndex] = _amountETH; }
Due to the volatility of the NFT market, the price assessment made 1 month ago may not be accurate anymore 1 month later.
Therefore, using a stale pendingNFTValueETH can be harmful as it may lead to undercollateralized loans or bad debt to the protocol.
pendingNFTValueETH
Consider adding an expiration time for every pendingNFTValueETH, and finalizePendingNFTValueETH can only be done before the expiration time.
finalizePendingNFTValueETH
In case of a stale pending NFT value the DAO can just remove it by setting it to 0
Out of scope
Lines of code
https://github.com/code-423n4/2022-04-jpegd/blob/e72861a9ccb707ced9015166fbded5c97c6991b6/contracts/vaults/NFTVault.sol#L347-L354
Vulnerability details
https://github.com/code-423n4/2022-04-jpegd/blob/e72861a9ccb707ced9015166fbded5c97c6991b6/contracts/vaults/NFTVault.sol#L347-L354
Due to the volatility of the NFT market, the price assessment made 1 month ago may not be accurate anymore 1 month later.
Therefore, using a stale
pendingNFTValueETH
can be harmful as it may lead to undercollateralized loans or bad debt to the protocol.Recommendation
Consider adding an expiration time for every
pendingNFTValueETH
, andfinalizePendingNFTValueETH
can only be done before the expiration time.