Skip to content
Business logic Audit finding Intermediate

Unstake cooldown period is mistakenly reset on each claim, resulting in temporary frozen funds

The unstake function resets the cooldown end time for the entire user-validator slot whenever a new unstake is made, extending the cooldown for previously unstaked amounts. An attacker could cause a user's funds to be temporarily frozen longer than intended by triggering additional unstake calls before the prior cooldown matures.

Plume Network

Originally disclosed on Immunefi

51980 sc low unstake cooldown period is mistakenly reset on each claim resulting in temporary frozen funds

Description

Summary

Each time a user calls unstake while there is already a cooling unstake amount, the cooldown end time is reset for that user's slot, effectively re-starting the cooldown for previously submitted unstake claims. This results in temporarily frozen funds.

Details

StakingFacet::unstake has incorrect cooldown handling. Example:

Alice stakes 100e18 tokens. She unstake 20e18 and must wait the cooldown period (e.g., 5 days) to withdraw. Before that cooldown finishes, she calls unstake again for 30e18. The implementation resets the cooldown end time for all cooled amounts in that user/validator slot, so the first 20e18's cooldown is extended and will only be withdrawable when the newest cooldown finishes — causing unintended freezing.

The problematic function flow (lines marked with ⇒):

Solidity
function _processCooldownLogic(
    address user,
    uint16 validatorId,
    uint256 amount
) internal returns (uint256 newCooldownEndTime) {
    PlumeStakingStorage.Layout storage $ = PlumeStakingStorage.layout();
    PlumeStakingStorage.CooldownEntry storage cooldownEntrySlot = $.userValidatorCooldowns[user][validatorId];

    uint256 currentCooledAmountInSlot = cooldownEntrySlot.amount;
    => uint256 currentCooldownEndTimeInSlot = cooldownEntrySlot.cooldownEndTime;

    uint256 finalNewCooledAmountForSlot;
    newCooldownEndTime = block.timestamp + $.cooldownInterval;

    if (currentCooledAmountInSlot > 0 && block.timestamp >= currentCooldownEndTimeInSlot) {
        // Previous cooldown for this slot has matured - move to parked and start new cooldown
        _updateParkedAmounts(user, currentCooledAmountInSlot);
        _removeCoolingAmounts(user, validatorId, currentCooledAmountInSlot);
        _updateCoolingAmounts(user, validatorId, amount);
        finalNewCooledAmountForSlot = amount;
    } else {
        // No matured cooldown - add to existing cooldown
        _updateCoolingAmounts(user, validatorId, amount);
         finalNewCooledAmountForSlot = currentCooledAmountInSlot + amount;
    }

    cooldownEntrySlot.amount = finalNewCooledAmountForSlot;
=>  cooldownEntrySlot.cooldownEndTime = newCooldownEndTime;

    return newCooldownEndTime;
}

Because cooldownEntrySlot.cooldownEndTime is always overwritten with newCooldownEndTime, earlier pending cooldowns in the same slot are extended rather than treated independently.

While funds are not lost, they can be temporarily frozen longer than intended.

Impact & severity

  • User funds can be temporarily frozen when making additional unstake calls before a prior cooldown matured.
  • The report classifies this as high severity (temporary freeze ≥ 24 hours). The metadata on this report lists severity as Low; the impact described indicates a higher practical severity due to typical multi-day cooldowns.

Recommendation

{% hint style="info" %} Do not reset the cooldown end time for the entire slot when adding a new cooling claim. Each claim should be tracked individually (or accumulated in a way that preserves existing matured timers) so previously initiated cooldowns are not extended by subsequent unstake calls. {% endhint %}

Example flow (intended vs current)

{% stepper %} {% step %}

Intended behavior

  • Alice unstakes 20e18 on Monday → wait 5 days → those 20e18 are withdrawable on Friday.
  • Alice unstakes an additional 30e18 on Thursday (4 days after the first unstake) → wait 5 days → those 30e18 are withdrawable next Monday.
  • Result: Alice can withdraw 20e18 on Friday and 30e18 on next Monday. {% endstep %}

{% step %}

Current (buggy) behavior

  • Alice unstakes 20e18 on Monday → cooldown set to Friday.
  • Alice unstakes 30e18 on Thursday → the slot cooldown end time is reset to Thursday+5 days.
  • Result: the first 20e18 cooldown is extended; Alice can only withdraw the combined 50e18 on next Monday (Thursday+5 days), freezing the original 20e18 longer than intended. {% endstep %} {% endstepper %}

Proof of Concept

{% stepper %} {% step %}

  1. Alice stakes 100e18 tokens. {% endstep %}

{% step %} 2. Monday: Alice calls unstake(20e18); cooldown = 5 days ⇒ withdrawable Friday. {% endstep %}

{% step %} 3. Thursday: Alice calls unstake(30e18); implementation resets slot cooldown ⇒ new cooldown ends next Monday. {% endstep %}

{% step %} 4. Result: Alice cannot withdraw her original 20e18 on Friday; it is frozen until next Monday (5 days longer). {% endstep %} {% endstepper %}

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

Plume Network is a staking system implemented as a set of Solidity facets. The target of this report is the staking facet, StakingFacet.sol, in the Attackathon repository:

Text
https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/facets/StakingFacet.sol

The feature in question is the unstake cooldown. When a user unstakes, the withdrawn amount does not become withdrawable immediately. It is placed into a cooling state for a cooldown period, and only after that period ends can the funds be moved out. The cooldown state is kept per user and per validator slot, in PlumeStakingStorage.layout().userValidatorCooldowns[user][validatorId], a CooldownEntry holding an amount and a cooldownEndTime.

The report describes a bug in how that single slot entry is updated when a user unstakes more than once before an earlier cooldown has matured.

Setup

The report does not describe any accounts, roles, tooling or deployed versions. It is a code-level review of the StakingFacet contract, and the only preconditions it relies on are:

  1. A user has staked tokens and can call unstake.
  2. The cooldown interval is non-zero. The report uses 5 days as an example value ($.cooldownInterval).
  3. The user calls unstake a second time while a previous unstake in the same user/validator slot is still cooling.

Finding it

The researcher looked at _processCooldownLogic, the internal function that StakingFacet::unstake uses to record a cooling amount. Two things in it stood out.

First, the new end time is computed unconditionally at the top of the function, before any branching:

Solidity
newCooldownEndTime = block.timestamp + $.cooldownInterval;

Second, at the end of the function, that value is written into the slot entry regardless of which branch was taken:

Solidity
cooldownEntrySlot.cooldownEndTime = newCooldownEndTime;

The branch structure distinguishes two cases: a previous cooldown in the slot that has already matured (moved to parked amounts and a fresh cooldown started), and a previous cooldown that has not matured (the new amount is added to the existing cooling amount). In the second case the amounts are accumulated, but the end time is still replaced with block.timestamp + cooldownInterval. That means the earlier amount, which was already part-way through its cooldown, gets its deadline pushed out to the new deadline. The report's example: Alice unstakes 20e18 and must wait the cooldown (for example 5 days); before that finishes she unstakes another 30e18, and the first 20e18 can now only be withdrawn when the newest cooldown finishes.

Exploitation

This is not an attack by a third party. The "exploitation" is the ordinary sequence of calls a user makes, and the effect is on that user's own funds. The report walks through it as a proof of concept.

Step 1: stake

Alice stakes 100e18 tokens.

Step 2: first unstake on Monday

Alice calls unstake(20e18). The cooldown is 5 days, so those 20e18 are withdrawable on Friday.

Step 3: second unstake on Thursday

Alice calls unstake(30e18). The implementation resets the slot cooldown, so the new cooldown ends the following Monday.

Step 4: result

Alice cannot withdraw her original 20e18 on Friday. It is frozen until the following Monday, 5 days longer than intended.

The report also contrasts intended and current behaviour directly:

Intended Current (buggy)
Monday Unstake 20e18, cooldown ends Friday Unstake 20e18, cooldown set to Friday
Thursday Unstake 30e18, cooldown ends next Monday Unstake 30e18, slot cooldown reset to Thursday + 5 days
Withdrawal 20e18 on Friday, 30e18 on next Monday Combined 50e18 only on next Monday

The report does not include any transaction hashes, logs, traces or test output; the proof of concept is the sequence of calls above.

Root cause

The faulty function is _processCooldownLogic. The report reproduces it with the two problematic lines marked:

Solidity
function _processCooldownLogic(
    address user,
    uint16 validatorId,
    uint256 amount
) internal returns (uint256 newCooldownEndTime) {
    PlumeStakingStorage.Layout storage $ = PlumeStakingStorage.layout();
    PlumeStakingStorage.CooldownEntry storage cooldownEntrySlot = $.userValidatorCooldowns[user][validatorId];

    uint256 currentCooledAmountInSlot = cooldownEntrySlot.amount;
    => uint256 currentCooldownEndTimeInSlot = cooldownEntrySlot.cooldownEndTime;

    uint256 finalNewCooledAmountForSlot;
    newCooldownEndTime = block.timestamp + $.cooldownInterval;

    if (currentCooledAmountInSlot > 0 && block.timestamp >= currentCooldownEndTimeInSlot) {
        // Previous cooldown for this slot has matured - move to parked and start new cooldown
        _updateParkedAmounts(user, currentCooledAmountInSlot);
        _removeCoolingAmounts(user, validatorId, currentCooledAmountInSlot);
        _updateCoolingAmounts(user, validatorId, amount);
        finalNewCooledAmountForSlot = amount;
    } else {
        // No matured cooldown - add to existing cooldown
        _updateCoolingAmounts(user, validatorId, amount);
         finalNewCooledAmountForSlot = currentCooledAmountInSlot + amount;
    }

    cooldownEntrySlot.amount = finalNewCooledAmountForSlot;
=>  cooldownEntrySlot.cooldownEndTime = newCooldownEndTime;

    return newCooldownEndTime;
}

The design keeps one CooldownEntry per user and validator, with a single amount and a single cooldownEndTime. When a new cooling claim arrives while an old one is still pending, the amounts are summed in the else branch, but the end time is overwritten with block.timestamp + $.cooldownInterval. Because cooldownEntrySlot.cooldownEndTime is always overwritten with newCooldownEndTime, earlier pending cooldowns in the same slot are extended rather than treated independently.

The report does not discuss any other checks or defences that would have prevented this; the slot model itself is the reason the earlier deadline cannot survive a second claim.

Impact

Funds are not lost. They can be temporarily frozen longer than intended: a user who unstakes again before a prior cooldown matures has the earlier amount's withdrawal pushed back to the new cooldown end. The report lists the impact as temporary freezing of funds for at least 24 hours.

There is a discrepancy in severity within the report itself. The report states that it classifies the issue as high severity (temporary freeze of 24 hours or more), while the metadata on the report lists severity as Low. The impact described indicates a higher practical severity due to typical multi-day cooldowns. The platform record for this report lists it as Low.

Fix

The recommendation is not to reset the cooldown end time for the entire slot when adding a new cooling claim. Each claim should be tracked individually, or accumulated in a way that preserves existing matured timers, so that previously initiated cooldowns are not extended by subsequent unstake calls. The report does not state that a fix was applied.

Variants to test

  1. Per-slot versus per-claim accounting. Look for any staking, vesting or withdrawal queue that stores one deadline per user (or per user/asset pair) and adds new amounts into it. A positive result is a second deposit or request that moves the existing deadline forward.
  2. Matured versus unmatured branches. In the same function, check whether the matured branch and the unmatured branch both write the same end-time variable. If the matured branch correctly parks the old amount but the unmatured branch still overwrites the deadline, the bug is present for the unmatured case only.
  3. Multiple validators or assets. Because the entry is keyed by user and validatorId, test whether unstaking against a different validator leaves the first slot's deadline untouched. A positive result for the bug is a reset within the same key; a reset across keys would be a separate, wider issue.
  4. Repeated small claims. Submit many small unstake calls in quick succession and observe whether the deadline keeps sliding forward with each call, which would extend the freeze indefinitely for a user who keeps adding claims.
  5. Cooldown interval changes. If the cooldown interval is configurable, check whether a change to it affects already pending entries, since the end time is recomputed from the current interval on each call.

Hunting notes

This kind of bug hides in accounting code that keeps a single aggregate record per user and mutates it on every new request: staking and unstaking, withdrawal queues, reward claims with lockups, and any "cooldown" or "pending" bucket. During review, the signal is a function that computes a fresh deadline near the top and writes it to storage at the bottom, outside the branch that decides whether the old amount had matured. If the amount is accumulated but the deadline is replaced, earlier requests lose their original timing.

To show enough impact, the report reduces the issue to a concrete timeline with named days and amounts (20e18 on Monday, 30e18 on Thursday, withdrawal only on the following Monday) and states the extra freeze in days. It also separates intended from current behaviour so the reviewer can see exactly which deadline should have survived. The report does not include a runnable test or on-chain evidence, so the argument rests on the code path and the timeline.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 17 min read.

What happened, in plain words

Plume Network is a system where people can lock up digital tokens (called "staking") and later take them back out (called "unstaking"). When you unstake, the tokens do not come back to you instantly. They sit in a waiting room for a set number of days, called a cooldown period. Only after that waiting period ends can you actually move the tokens out.

The bug in this report is about what happens when you unstake a second time while your first unstake is still waiting. Instead of keeping the two waiting periods separate, the system restarts the clock for everything in that waiting room. So the tokens from your first unstake, which were almost ready, get pushed back to the end of the new waiting period. Your money is not stolen or lost, but it stays locked up longer than it should.

Think of it like a parcel locker with one timer. You drop in parcel A and the locker says "ready in 5 days". Two days later you drop in parcel B, and instead of the locker remembering that A is ready in 3 days, it resets the whole locker to "ready in 5 days". Now A waits 7 days in total instead of 5.

Context

Plume Network's staking code is written in Solidity, the programming language used for smart contracts on Ethereum-style blockchains. A smart contract is a program that lives on the blockchain and runs automatically when people send it instructions. Nobody can quietly change its behaviour after it is deployed, which is why bugs in it matter so much.

The code is organised into pieces called "facets". A facet is a module of a larger contract, a bit like one chapter of a book: it handles one area of functionality. The target of this report is the staking facet, StakingFacet.sol, in the Attackathon repository:

Text
https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/facets/StakingFacet.sol

This is a link to the source code on GitHub, a website where code is stored and shared. Anyone can open it and read the file.

The feature in question is the unstake cooldown. When a user unstakes, the withdrawn amount does not become withdrawable immediately. It is placed into a cooling state for a cooldown period, and only after that period ends can the funds be moved out. The cooldown state is kept per user and per validator slot, in PlumeStakingStorage.layout().userValidatorCooldowns[user][validatorId], a CooldownEntry holding an amount and a cooldownEndTime.

Let us unpack that sentence, because it is dense.

  • A "validator" is a participant in the network that helps run it. Users stake their tokens through validators, so each user has a separate record for each validator they use. That pairing is called a "slot".
  • The system stores its data in a structure called PlumeStakingStorage. The .layout() part is a helper that returns the storage area where the staking data lives.
  • Inside that storage, userValidatorCooldowns[user][validatorId] is a lookup table: give it a user and a validator, and it returns that user's cooldown record for that validator. The square brackets are how you look up a value by key, like looking up a word in a dictionary.
  • Each record is a CooldownEntry, which holds two things: an amount (how many tokens are waiting) and a cooldownEndTime (the moment the waiting period finishes).

The report describes a bug in how that single slot entry is updated when a user unstakes more than once before an earlier cooldown has matured. "Matured" simply means the waiting period has finished.

Setup

The report does not describe any accounts, roles, tooling or deployed versions. It is a code-level review of the StakingFacet contract, and the only preconditions it relies on are:

  1. A user has staked tokens and can call unstake.
  2. The cooldown interval is non-zero. The report uses 5 days as an example value ($.cooldownInterval).
  3. The user calls unstake a second time while a previous unstake in the same user/validator slot is still cooling.

In plain terms: you need tokens already staked, a waiting period that is longer than zero, and a second unstake made before the first one has finished waiting. No special tools, no hacking, no third party. The user triggers the bug just by using the product normally.

Finding it

The researcher looked at _processCooldownLogic, the internal function that StakingFacet::unstake uses to record a cooling amount. An internal function is a helper that other parts of the same contract call; users do not call it directly. Two things in it stood out.

First, the new end time is computed unconditionally at the top of the function, before any branching:

Solidity
newCooldownEndTime = block.timestamp + $.cooldownInterval;

Line by line:

  • block.timestamp is the current time according to the blockchain, expressed as a number of seconds since a fixed starting point in 1970. Every transaction sees the time of the block it is included in.
  • $.cooldownInterval is the configured length of the waiting period, for example 5 days expressed in seconds.
  • Adding them together gives the moment when a waiting period that starts now would end.
  • newCooldownEndTime = ... stores that moment in a variable.

The key word is "unconditionally": this line runs every single time the function is called, whether or not there is already something waiting.

Second, at the end of the function, that value is written into the slot entry regardless of which branch was taken:

Solidity
cooldownEntrySlot.cooldownEndTime = newCooldownEndTime;

Line by line:

  • cooldownEntrySlot is the record for this user and validator, fetched earlier in the function.
  • .cooldownEndTime is the field inside that record that says when the waiting period ends.
  • The = assigns the freshly computed time to that field, overwriting whatever was there before.

So the deadline is recalculated at the top and stamped onto the record at the bottom, no matter what happened in between.

The branch structure distinguishes two cases: a previous cooldown in the slot that has already matured (moved to parked amounts and a fresh cooldown started), and a previous cooldown that has not matured (the new amount is added to the existing cooling amount). A "branch" is an if/else decision in code: the program takes one path or the other depending on a condition. "Parked amounts" are tokens that have finished cooling and are set aside, ready to be withdrawn.

In the second case the amounts are accumulated, but the end time is still replaced with block.timestamp + cooldownInterval. That means the earlier amount, which was already part-way through its cooldown, gets its deadline pushed out to the new deadline. The report's example: Alice unstakes 20e18 and must wait the cooldown (for example 5 days); before that finishes she unstakes another 30e18, and the first 20e18 can now only be withdrawn when the newest cooldown finishes.

A note on 20e18: this is programming notation for a very large whole number. The e18 means "times ten to the power of eighteen". Tokens on these systems are usually stored as whole numbers with 18 extra decimal places, so 20e18 represents 20 tokens. You do not need to do the arithmetic; just read it as "20 tokens" and "30 tokens".

Exploitation

This is not an attack by a third party. The "exploitation" is the ordinary sequence of calls a user makes, and the effect is on that user's own funds. In security language, "exploitation" means doing the thing that triggers the bug; it does not have to be malicious. Here the person harmed and the person triggering it are the same.

The report walks through it as a proof of concept. A proof of concept is a concrete demonstration that the problem is real, usually a short sequence of steps that anyone can follow.

Step 1: stake

Alice stakes 100e18 tokens. Staking means locking tokens into the contract.

Step 2: first unstake on Monday

Alice calls unstake(20e18). The cooldown is 5 days, so those 20e18 are withdrawable on Friday.

"Calls" means she sends a transaction to the contract asking it to run the unstake function with the argument 20e18. The report names Friday as the day the 20e18 becomes withdrawable.

Step 3: second unstake on Thursday

Alice calls unstake(30e18). The implementation resets the slot cooldown, so the new cooldown ends the following Monday.

This is the moment the bug fires. The first 20 tokens were still cooling when the second call was made. The second call does not create a second waiting room; it overwrites the single deadline in the shared record.

Step 4: result

Alice cannot withdraw her original 20e18 on Friday. It is frozen until the following Monday, 5 days longer than intended.

"Frozen" here means locked by the contract's own rules: the tokens still belong to Alice, but the contract will not let her move them until the recorded deadline passes.

The report also contrasts intended and current behaviour directly:

Intended Current (buggy)
Monday Unstake 20e18, cooldown ends Friday Unstake 20e18, cooldown set to Friday
Thursday Unstake 30e18, cooldown ends next Monday Unstake 30e18, slot cooldown reset to Thursday + 5 days
Withdrawal 20e18 on Friday, 30e18 on next Monday Combined 50e18 only on next Monday

The table is the clearest way to see the difference. In the intended design each unstake keeps its own deadline, so the user gets money back in two instalments. In the buggy design there is one deadline for the whole slot, and the later unstake drags the earlier one along with it.

The report does not include any transaction hashes, logs, traces or test output; the proof of concept is the sequence of calls above. A transaction hash is a unique identifier for a transaction on the blockchain, and a trace is a step-by-step record of what a transaction did. None of those are provided, so the argument rests on reading the code and following the timeline.

Root cause

The faulty function is _processCooldownLogic. The report reproduces it with the two problematic lines marked:

Solidity
function _processCooldownLogic(
    address user,
    uint16 validatorId,
    uint256 amount
) internal returns (uint256 newCooldownEndTime) {
    PlumeStakingStorage.Layout storage $ = PlumeStakingStorage.layout();
    PlumeStakingStorage.CooldownEntry storage cooldownEntrySlot = $.userValidatorCooldowns[user][validatorId];

    uint256 currentCooledAmountInSlot = cooldownEntrySlot.amount;
    => uint256 currentCooldownEndTimeInSlot = cooldownEntrySlot.cooldownEndTime;

    uint256 finalNewCooledAmountForSlot;
    newCooldownEndTime = block.timestamp + $.cooldownInterval;

    if (currentCooledAmountInSlot > 0 && block.timestamp >= currentCooldownEndTimeInSlot) {
        // Previous cooldown for this slot has matured - move to parked and start new cooldown
        _updateParkedAmounts(user, currentCooledAmountInSlot);
        _removeCoolingAmounts(user, validatorId, currentCooledAmountInSlot);
        _updateCoolingAmounts(user, validatorId, amount);
        finalNewCooledAmountForSlot = amount;
    } else {
        // No matured cooldown - add to existing cooldown
        _updateCoolingAmounts(user, validatorId, amount);
         finalNewCooledAmountForSlot = currentCooledAmountInSlot + amount;
    }

    cooldownEntrySlot.amount = finalNewCooledAmountForSlot;
=>  cooldownEntrySlot.cooldownEndTime = newCooldownEndTime;

    return newCooldownEndTime;
}

Line by line, in plain words:

  • function _processCooldownLogic(...) declares the helper. The leading underscore is a naming convention meaning "internal, not for users to call directly".
  • address user is the user's account address, a long string of characters that identifies them on the blockchain, like an account number.
  • uint16 validatorId is a small number identifying the validator. uint16 means an unsigned (non-negative) integer that fits in 16 bits.
  • uint256 amount is the number of tokens involved. uint256 is a very large unsigned integer, the standard size for token amounts.
  • internal returns (uint256 newCooldownEndTime) says the function is internal and hands back one number: the new end time.
  • PlumeStakingStorage.Layout storage $ = PlumeStakingStorage.layout(); fetches the contract's storage area and gives it the short name $. The storage keyword means this is a reference to data saved permanently on the blockchain, not a copy.
  • PlumeStakingStorage.CooldownEntry storage cooldownEntrySlot = $.userValidatorCooldowns[user][validatorId]; looks up the cooldown record for this user and validator and keeps a reference to it. Because it is a reference, changing it changes the saved data.
  • uint256 currentCooledAmountInSlot = cooldownEntrySlot.amount; reads how many tokens are already waiting in this slot.
  • The line marked with => reads the existing deadline into currentCooldownEndTimeInSlot. The arrow is the report's way of pointing at a relevant line; it is not part of the code.
  • uint256 finalNewCooledAmountForSlot; declares a variable to hold the amount that will be saved at the end.
  • newCooldownEndTime = block.timestamp + $.cooldownInterval; computes the deadline for a cooldown starting right now. This is the first problem: it runs before the code knows whether there is already something waiting.
  • if (currentCooledAmountInSlot > 0 && block.timestamp >= currentCooldownEndTimeInSlot) { asks two questions at once: is there already an amount waiting, and has its deadline already passed? Both must be true to enter this branch.
  • Inside that branch, _updateParkedAmounts(...) moves the matured amount to the parked pile, _removeCoolingAmounts(...) takes it out of the cooling pile, and _updateCoolingAmounts(...) puts the new amount into cooling. Then finalNewCooledAmountForSlot = amount; says the slot now holds only the new amount. In this branch the slot now holds only the new amount.
  • } else { covers everything else, which in practice means there is an amount still waiting whose deadline has not passed.
  • _updateCoolingAmounts(user, validatorId, amount); adds the new amount to the cooling pile.
  • finalNewCooledAmountForSlot = currentCooledAmountInSlot + amount; sets the slot total to the old amount plus the new one. So the amounts are correctly added together.
  • cooldownEntrySlot.amount = finalNewCooledAmountForSlot; saves the combined amount back to the record.
  • The line marked with =>, cooldownEntrySlot.cooldownEndTime = newCooldownEndTime;, saves the freshly computed deadline. This is the second problem: it runs after both branches, so even in the else case, where the old amount was still waiting, the old deadline is thrown away.
  • return newCooldownEndTime; hands the deadline back to the caller.

The design keeps one CooldownEntry per user and validator, with a single amount and a single cooldownEndTime. When a new cooling claim arrives while an old one is still pending, the amounts are summed in the else branch, but the end time is overwritten with block.timestamp + $.cooldownInterval. Because cooldownEntrySlot.cooldownEndTime is always overwritten with newCooldownEndTime, earlier pending cooldowns in the same slot are extended rather than treated independently.

The report does not discuss any other checks or defences that would have prevented this; the slot model itself is the reason the earlier deadline cannot survive a second claim. In other words, the data structure only has room for one deadline, so there is nowhere for the first deadline to be remembered.

Impact

Funds are not lost. They can be temporarily frozen longer than intended: a user who unstakes again before a prior cooldown matures has the earlier amount's withdrawal pushed back to the new cooldown end. The report lists the impact as temporary freezing of funds for at least 24 hours.

"Temporary freezing of funds" is a standard category in bug bounty programmes. It means the money is safe and still owned by the user, but cannot be moved for a period. It is less serious than theft, but it still breaks the promise the product makes about when users can get their tokens back.

There is a discrepancy in severity within the report itself. The report states that it classifies the issue as high severity (temporary freeze of 24 hours or more), while the metadata on the report lists severity as Low. The impact described indicates a higher practical severity due to typical multi-day cooldowns. The platform record for this report lists it as Low.

Severity is the label a programme uses to rank how serious a finding is, usually from low to critical. Metadata is the structured information attached to a report, such as its title, target and severity, separate from the prose the researcher writes. Here the two disagree, and the report itself points that out.

Fix

The recommendation is not to reset the cooldown end time for the entire slot when adding a new cooling claim. Each claim should be tracked individually, or accumulated in a way that preserves existing matured timers, so that previously initiated cooldowns are not extended by subsequent unstake calls. The report does not state that a fix was applied.

In everyday terms: give each waiting parcel its own timer, or at least keep the earliest deadline intact when adding a new one. Do not let a new arrival reset the clock for everything already in the locker.

Variants to test

These are places where the same kind of mistake might appear elsewhere. Testing a variant means checking whether the same pattern shows up in other code.

  1. Per-slot versus per-claim accounting. Look for any staking, vesting or withdrawal queue that stores one deadline per user (or per user/asset pair) and adds new amounts into it. A positive result is a second deposit or request that moves the existing deadline forward. "Accounting" here means the bookkeeping of who is owed what and when.
  2. Matured versus unmatured branches. In the same function, check whether the matured branch and the unmatured branch both write the same end-time variable. If the matured branch correctly parks the old amount but the unmatured branch still overwrites the deadline, the bug is present for the unmatured case only.
  3. Multiple validators or assets. Because the entry is keyed by user and validatorId, test whether unstaking against a different validator leaves the first slot's deadline untouched. A positive result for the bug is a reset within the same key; a reset across keys would be a separate, wider issue. "Keyed by" means the lookup table uses those two values to find the record.
  4. Repeated small claims. Submit many small unstake calls in quick succession and observe whether the deadline keeps sliding forward with each call, which would extend the freeze indefinitely for a user who keeps adding claims.
  5. Cooldown interval changes. If the cooldown interval is configurable, check whether a change to it affects already pending entries, since the end time is recomputed from the current interval on each call.

Hunting notes

This kind of bug hides in accounting code that keeps a single aggregate record per user and mutates it on every new request: staking and unstaking, withdrawal queues, reward claims with lockups, and any "cooldown" or "pending" bucket. "Aggregate" means one combined record rather than one per item, and "mutates" means changes the saved data.

During review, the signal is a function that computes a fresh deadline near the top and writes it to storage at the bottom, outside the branch that decides whether the old amount had matured. If the amount is accumulated but the deadline is replaced, earlier requests lose their original timing.

To show enough impact, the report reduces the issue to a concrete timeline with named days and amounts (20e18 on Monday, 30e18 on Thursday, withdrawal only on the following Monday) and states the extra freeze in days. It also separates intended from current behaviour so the reviewer can see exactly which deadline should have survived. The report does not include a runnable test or on-chain evidence, so the argument rests on the code path and the timeline.

Glossary

  • Smart contract: a program stored on a blockchain that runs automatically when called and cannot be quietly changed after deployment.
  • Solidity: the programming language used to write smart contracts on Ethereum-style blockchains.
  • Facet: a module of a larger smart contract that handles one area of functionality.
  • Staking: locking tokens into a system, usually to support the network or earn a return.
  • Unstaking: asking the system to return staked tokens.
  • Cooldown period: a waiting time during which unstaked tokens cannot yet be withdrawn.
  • Matured: said of a cooldown whose waiting period has finished.
  • Validator: a network participant through which users stake tokens.
  • Slot: the pairing of one user and one validator, used as the key for that user's cooldown record.
  • Storage: the part of a smart contract where data is saved permanently on the blockchain.
  • Lookup table: a data structure that returns a value when given a key, like a dictionary.
  • Struct / record: a bundle of related fields stored together, here an amount and an end time.
  • Function: a named block of code that performs a task and can be called by other code or by users.
  • Internal function: a helper function that only other parts of the same contract can call.
  • Argument / parameter: a value passed into a function when it is called.
  • address: a blockchain account identifier, a long string of characters.
  • uint16 / uint256: unsigned (non-negative) integer types of different sizes; uint256 is the standard size for token amounts.
  • block.timestamp: the current time according to the blockchain, in seconds since a fixed starting point in 1970.
  • Branch: an if/else decision in code that chooses one path or another.
  • Variable: a named place in code that holds a value.
  • Assignment (=): writing a value into a variable or storage field, overwriting what was there.
  • Reference: a handle to saved data such that changes through it affect the saved data itself.
  • 20e18 notation: shorthand for 20 times ten to the eighteenth power, the way 20 tokens are usually represented.
  • Proof of concept: a concrete sequence of steps demonstrating that a problem is real.
  • Exploitation: the act of triggering a bug; it does not have to be malicious.
  • Temporary freezing of funds: money that is safe and still owned by the user but cannot be moved for a period.
  • Severity: a label ranking how serious a finding is, usually from low to critical.
  • Metadata: the structured information attached to a report, such as title, target and severity, separate from its prose.
  • Transaction hash: a unique identifier for a transaction on the blockchain.
  • Trace: a step-by-step record of what a transaction did.
  • Aggregate record: one combined record for many items, rather than one record per item.
  • Mutate: to change saved data.
  • Accounting: the bookkeeping of who is owed what and when.
  • Vesting: releasing tokens gradually over time rather than all at once.
  • Withdrawal queue: a list of pending requests to take funds out, processed in order.
  • Lockup: a period during which funds cannot be moved.
  • Keyed by: said of a lookup table that uses given values to find a record.

More from Plume Network

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.