Wrong `CHANGE_COLLATERAL_DELAY` in CollateralBook
The contract's constant for the collateral change delay was set to 200 seconds instead of the intended 2 days, allowing an admin to bypass the time delay and change collateral type after waiting only about 3 minutes and 20 seconds.
Source: https://github.com/sherlock-audit/2022-11-isomorph-judging/issues/191
Found by
Jeiwan, ctf_sec, yixxas, CodingNameKiki, GimelSec, rvierdiiev, 0xjayne
Summary
Admins can bypass time delay due to the wrong value of CHANGE_COLLATERAL_DELAY.
Vulnerability Detail
The comment shows that the CHANGE_COLLATERAL_DELAY should be 2 days, but it's only 200 which means 3 minutes and 20 seconds.
Impact
Admin can bypass the 2 days time delay and only need to wait less than 5 minutes to call changeCollateralType.
Code Snippet
https://github.com/sherlock-audit/2022-11-isomorph/blob/main/contracts/Isomorph/contracts/CollateralBook.sol#L23 https://github.com/sherlock-audit/2022-11-isomorph/blob/main/contracts/Isomorph/contracts/CollateralBook.sol#L130
Tool used
Manual Review
Recommendation
uint256 public constant CHANGE_COLLATERAL_DELAY = 2 days; //2 days
Discussion
hrishibhat
Fix PR:
kree-dotcom/isomorph@9bad274
0x00052
Wrong PR linked but delay has been changed from 200 to 2 days
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An admin could bypass the intended 2-day delay and change collateral type after waiting less than 5 minutes.
What the attacker needed
Admin privileges
The fix
The constant should be set to 2 days, and the text indicates the delay was changed from 200 to 2 days.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract had a setting that was supposed to make administrators wait two days before changing something important. Instead, the wait was only about three minutes, so an admin could make the change much sooner than intended.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.