Function cooldown() is not protected when protocol in emergency mode
The cooldown() function in the HolyPaladinToken contract lacks the emergency mode check that other major functions have. During emergency mode, users can still initiate cooldown, potentially allowing them to prepare for unstaking once the emergency is lifted.
Submitted by hubble
HolyPaladinToken.sol#L228-L235
Function cooldown() is not protected when protocol is in emergency mode. Its behavior is not consistent with the other major functions defined.
Impact
While other major functions like stake, unstake, lock, unlock, etc., of this contract is protected by checking for emergency flag and reverting, this function cooldown() is not checked. The impact of this is that during emergency mode, users can set immediately the cooldown() and plan for unstaking when the emergency mode is lifted and cooldown period expires. This may not be the desirable behaviour expected by the protocol.
Proof of Concept
Contract Name : HolyPaladinToken.sol Function cooldown()
Recommended Mitigation Steps
Add checking for emergency mode for this function also.
if(emergency) revert EmergencyBlock();
Kogaroshi (Paladin) confirmed, resolved, and commented:
Changes made in: PaladinFinance/Paladin-Tokenomics#10.
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
Root cause
The cooldown() function omitted the emergency mode check that other major functions include.
Impact
During emergency mode, users could initiate cooldown and be ready to unstake as soon as the emergency is lifted and the cooldown period expires, which may not be the intended behaviour.
What the attacker needed
Protocol in emergency mode
The fix
The function should be updated to check the emergency flag and revert if emergency mode is active; the report states the issue was resolved.
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.
In a smart contract, an emergency mode is a switch that pauses certain actions to protect users. Here, one function that starts a waiting period for withdrawing tokens was not paused, so people could still start that waiting period even while the protocol was in emergency mode.
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.