49941 sc low permanent freezing of yield tokens due to flawed check in distribution logic
Description
Short summary
Background Information
// File: arc/src/ArcToken.sol
function distributeYield(
uint256 amount
) external onlyRole(YIELD_DISTRIBUTOR_ROLE) nonReentrant {
// ...
// The funds are transferred IN before any checks
yToken.safeTransferFrom(msg.sender, address(this), amount);
uint256 holderCount = $.holders.length();
uint256 holderCount = $.holders.length();
if (holderCount == 0) { // <-- @audit-issue VULNERABILITY HERE
emit YieldDistributed(0, yieldTokenAddr);
return;
}
uint256 effectiveTotalSupply = 0;
for (uint256 i = 0; i < holderCount; i++) {
address holder = $.holders.at(i);
if (_isYieldAllowed(holder)) {
effectiveTotalSupply += balanceOf(holder);
}
}
if (effectiveTotalSupply == 0) { // <-- @audit-issue VULNERABILITY HERE
emit YieldDistributed(0, yieldTokenAddr);
return;
}
//...
}The vulnerability
Vulnerability Details
Note
Potential Failure Scenario
Severity assessment
Suggested Fix / Remediation
Proof of Concept
Previous51813 sc high malicious user can grief victims by staking them across many validators leading to fund freezingNext51802 sc low temporary freeze of rewards is possible if efficientsupply 0
Was this helpful?