Skip to content
Business logic Audit finding Beginner

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.

hubble Follow

Originally disclosed on Code4rena

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.


The original report as published on Code4rena, by hubble. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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.

More by hubble

View all

11 more disclosed reports, best first.

More from Paladin - Warden Pledges contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.