89224 sc high inclusive boundary redemption lets a shareholder retain collateral and underpay a covered claim
Submitted on Aug 17th 2026 at 22:13:17 UTC by @Paludo0x for Audit Comp | Firelight
Report ID: #89224
Report Type: Smart Contract
Report severity: High
Target: https://github.com/immunefi-team/audit-comp-firelight/blob/v1_audit_ready/contracts/core/FirelightVault.sol
Impacts:
Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Description
Brief/Intro
Firelight can pay less than an approved covered loss when a shareholder redeems shares at the start of a period. The redemption lowers the recorded balance of active assets. The redeemed assets remain available for claims because they sit in a pending withdrawal balance. Payout uses the lower recorded balance to set its limit. If the covered loss event closes after that payment, the beneficiary cannot collect the remaining amount through the normal process, while the shareholder can later claim the pending withdrawal.
Vulnerability Details
Firelight calls a covered loss event an incident. The IncidentManager contract processes the incident, including its assessment and closure. Firelight needs the amount of collateral exposed when the incident period begins. It keeps active assets in timestamp checkpoints. It keeps assets waiting for withdrawal in a separate balance. A redemption at the exact period boundary reduces the active assets balance. The withdrawal balance still treats those redeemed assets as collateral for claims from that period. The error is that payout() reads the reduced balance as the balance at the start of the period.
How the incorrect balance is used
FirelightVault::redeem() starts the withdrawal before it records the new vault balances
// contracts/core/FirelightVault.sol:717-742
uint256 ownerBalance = _requestWithdraw(assets, shares, receiver, owner);
_logTrace(owner, ownerBalance, _totalSupply - shares, _totalAssets - assets, true);FirelightVault::_requestWithdraw() adds the assets to withdrawAssets[currentPeriod() + 1]. The same redemption reduces _totalAssets and keeps the redeemed assets in a pending withdrawal balance. That balance remains part of the collateral used for claims from the current period.
FirelightVault::_logTrace() writes the reduced active total under block.timestamp
// contracts/core/FirelightVault.sol:1044-1055
uint48 ts = Time.timestamp();
_traceTotalSupply.push(ts, _totalSupply);
if (isLogAssets) _traceTotalAssets.push(ts, _totalAssets);The trace has no separate value for the balance before and after a redemption at the same timestamp. The attack requires the redemption transaction to enter a block at the exact start of the next period. The recorded value at that time then contains the smaller balance after redemption.
FirelightVault::totalAssetsAt() uses an inclusive lookup
// contracts/core/FirelightVault.sol:456-457
function totalAssetsAt(uint48 timestamp) public view returns (uint256) {
return _traceTotalAssets.upperLookupRecent(timestamp);
}upperLookupRecent() returns the newest checkpoint with a timestamp lower than or equal to the requested time. Therefore, totalAssetsAt(periodStart) can select the checkpoint written by the boundary redemption. The payout should use the balance that existed before that redemption.
FirelightVault::payout() includes delayed withdrawals in payable collateral but caps the result with the active assets snapshot
// contracts/core/FirelightVault.sol:911-935
uint256 assetsAtCapturePeriod = totalAssetsAt(capturePeriodStart);
uint256 currentActiveAssets = totalAssets();
uint256 capturePeriodWithdrawals = withdrawAssets[capturePeriod + 1];
uint256 activePayableAmount = currentActiveAssets + capturePeriodWithdrawals + nextPeriodWithdrawals;
paidAmount = Math.min(amount, Math.min(assetsAtCapturePeriod, activePayableAmount));activePayableAmount includes assets from the withdrawal balances. However, the final line also limits payment by assetsAtCapturePeriod. After a boundary redemption, this value can be lower than the collateral still exposed to the claim. The payout then uses the reduced active assets balance as its cap, even though the withdrawal balance still includes the same assets as claim collateral.
IncidentManager::approveCurrentAssessment() processes the final assessment and closes the incident
// contracts/core/IncidentManager.sol:425-438
uint256 vaultPaidAmount = _executePayout(
$,
incidentId,
assessmentRoundId,
incident.period,
incident.captureTimestamp,
totalAssessmentLoss
);
if (vaultPaidAmount > 0) incident.vaultPaidAmount = vaultPaidAmount;
incident.status = IncidentStatus.CLOSED;The IncidentManager contract stores any nonzero amount returned by the vault and closes the incident. It does not require the vault payment to equal totalAssessmentLoss. The normal incident process does not provide another payment after closure. The shareholder can later claim the pending withdrawal.
Attack path
Impact Details
Funds at risk: the part of an approved claim above the period start active assets checkpoint, when delayed withdrawals still expose more collateral to the same claim.
Who loses: the covered payout beneficiary loses the unpaid claim amount; the shareholder retains collateral that should have funded that claim.
Repeatability: the condition can recur at each period boundary for a shareholder with a valid withdrawal request and an affected cover period.
Autonomous worsening: the incident remains underpaid after closure, and later withdrawal claims preserve the collateral that the closed incident failed to consume.
No automatic recovery: pausing future vault actions does not repair the checkpoint or reopen the closed incident. Recovery requires a code upgrade, migration, or external compensation.
Severity: Critical. The bug causes direct loss of funds to a covered beneficiary and lets a shareholder retain vault collateral that should pay the claim. The exact boundary time reduces execution probability, but it does not remove the direct asset impact.
Recommended Fix
Read the checkpoint immediately before the period start. Another option is to store an immutable exposure value before any new redemption. The lookup must exclude checkpoints written at capturePeriodStart by a redemption in that same block:
Proof of Concept
PoC Explanation
deployBoundaryCheckpointIncident()starts from the developers'deployVault()fixture intest/setup/fixtures.js. This fixture deploys the realFirelightVaultproxy, the FAsset test token, and the vault roles.The helper then deploys and connects the real
CoverNFT,CoverOrderAllocator, andIncidentManagercontracts. It does not use the mock vault or mock allocator from the separate component fixtures.The test creates a valid cover order, redeems at the exact period boundary, commits and settles the allocation, and processes the covered loss through the normal incident flow.
It checks that an approved loss of 200,000 pays only 100,000, the incident closes, and the shareholder later claims the remaining withdrawal.
Run it with
npx hardhat test test/FirelightVault/boundaryCheckpointIncident.poc.js.
Actual Hardhat output:
Was this helpful?