53077 sc high permanent fund lock due to flawed remainder logic in distributeyield
Description
Brief / Intro
Vulnerability Details
if (holderCount > 0) {
address lastHolder = $.holders.at(lastProcessedIndex);
// This 'if' statement is the source of the vulnerability.
if (_isYieldAllowed(lastHolder)) {
uint256 lastShare = amount - distributedSum;
if (lastShare > 0) {
yToken.safeTransfer(lastHolder, lastShare);
distributedSum += lastShare;
}
}
// MISSING LOGIC: There is no 'else' block here. If the check above
// fails, the 'lastShare' is never handled. It's simply abandoned.
}
emit YieldDistributed(distributedSum, yieldTokenAddr);Impact Details
Recommendation
Proof of Concept (PoC)
Notes
PreviousPlume | AttackathonNext53072 sc high ceil vs floor rounding mismatch causes systematic underpayment and unclaimed yield leakage
Was this helpful?