Firelight — Write-up
← Back

Firelight · Audit competition · 2026-08

Rescuing a blocked user's withdrawal could permanently freeze their next one

Severity:High
Impact:Permanent freezing of funds
Note:Critical impact, rated High by the project for low likelihood.

In Firelight's vault, rescuing a blocked account's pending withdrawal could leave that account's next withdrawal permanently unclaimable. Administrators can block an account and move its pending withdrawal to a safe address. That rescue also marked the account's withdrawal for the day as already paid, while it could still grow. If the account were then unblocked and withdrew again the same day, its shares would be destroyed and the money could never be claimed. Found in the Firelight audit competition on Immunefi in August 2026, in an upgrade that was under review; no user funds were frozen.

Background

Users deposit FXRP into the vault and hold shares in it. Getting money out takes two steps:

  1. Request. The user's shares are destroyed at once, and the amount is written into the user's withdrawal slot for the next period. A period is 24 hours on the live vault. Every request made during the same period is added to the same slot.
  2. Claim. Once that period has ended, the user collects the whole slot in one payment.

A slot can be paid only once. The contract remembers this with a per-user, per-period "claimed" flag (isWithdrawClaimed), and nothing ever resets that flag.

The vault also has a compliance flow. One admin role can block and unblock an account (BLOCKLIST_ROLE). Another can move a blocked account's pending withdrawal to a different address (RESCUER_ROLE).

How it worked

1. The flag is final, but the slot is not. Until the next period starts, a new request keeps adding to the same slot (_requestWithdraw):

uint256 period = currentPeriod() + 1;
// ...
withdrawSharesOf[period][receiver] += sharesWithdraw;
pendingWithdrawAssets += assets;
// ...
_update(owner, address(0), shares); // the shares are destroyed here

The claim pays the slot out and uses the flag as its only "already paid" marker (claimWithdraw):

if (isWithdrawClaimed[period][sender]) revert AlreadyClaimedPeriod(period);
// ...
pendingWithdrawAssets -= assets;
isWithdrawClaimed[period][sender] = true;

That is safe for a claim, because a claim is only allowed after the slot has closed.

2. The rescue sets the same flag on a slot that is still open. Moving a blocked account's pending withdrawal (rescueWithdrawFromBlocklisted):

uint256 _withdrawOf = withdrawSharesOf[periods[i]][from];

if (isWithdrawClaimed[periods[i]][from]) revert AlreadyClaimedPeriod(periods[i]);
if (isWithdrawClaimed[periods[i]][to]) revert AlreadyClaimedPeriod(periods[i]);
if (_withdrawOf == 0) revert NoWithdrawalAmount(periods[i]);

withdrawSharesOf[periods[i]][to] += _withdrawOf;
withdrawSharesOf[periods[i]][from] = 0;
isWithdrawClaimed[periods[i]][from] = true; // marks the slot as paid for good

The last line is not needed: the slot's balance is already zero, so a second rescue or a claim would fail anyway. But a rescue happens while the withdrawal is still pending, which is exactly when the slot still accepts new requests.

3. The sequence. A scenario, not something that happened. All within one 24-hour period:

  1. The user requests a withdrawal.
  2. An admin blocks the account.
  3. An admin rescues the pending withdrawal to a safe address. The user's slot is now marked as paid.
  4. An admin unblocks the account.
  5. The user makes an ordinary withdrawal of what they still hold. The amount lands in the same slot, and the shares are destroyed.

From then on the claim fails with AlreadyClaimedPeriod. A second rescue fails on the same flag, and the other rescue function, which moves shares, has nothing to move because the shares no longer exist.

Impact

The second withdrawal would be frozen for good: no admin function touches the flag, and waiting does not lift it. The vault would also keep counting the frozen amount as owed and under-report its own capital by the same amount.

None of this happened on the live vault. To measure it, I ran the sequence in a test on a local copy of the chain (a Flare mainnet fork), using a real shareholder's balance: 8,989,000.1496 FXRP, the holder's entire position, ended up unclaimable. With the flag cleared and nothing else changed, the same test paid out the full amount.

The user would do nothing unusual: request a withdrawal and later withdraw the rest. The other three steps are the vault's own compliance flow. The unblocking and the next request must fall inside the same period; a later request goes into a fresh slot.

Timeline

Date Event
24 Aug 2026 Reported via Immunefi
25 Aug 2026 Confirmed by Firelight
22 Sep 2026 Fix committed: the rescue no longer sets the flag
30 Sep 2026 Bounty paid

Takeaway

Admin and compliance paths run rarely and get tested least, but they write to the same state as the main flow. Each reused flag carries a condition under which it is safe. Here it was "the slot is closed", and the rescue ran while it was open.

Done

Shchepetov