#47106 [SC-Low] Collateral Reservation Fee distribution uses current poolFeeShareBips instead of value stored during during time of collateral reservation
Description
Brief/Intro
Vulnerability Details
function distributeCollateralReservationFee(
Agent.State storage _agent,
uint256 _fee // reservationFeeNatWei + executorFeeNatGWei
)
internal
{
if (_fee == 0) return;
// @audit BUG this uses agent.poolFeeShareBIPS state var, which might have been updated
uint256 poolFeeShare = _fee.mulBips(_agent.poolFeeShareBIPS);
_agent.collateralPool.depositNat{value: poolFeeShare}();
IIAgentVault(_agent.vaultAddress()).depositNat{value: _fee - poolFeeShare}(Globals.getWNat());
}Impact Details
References
Proof of Concept
Proof of Concept
Previous#47091 [SC-Insight] `setWorkAddress()` enables front-running attacks to hijack work addressesNext#47094 [SC-Insight] Missing Event Emission in `AgentVault` and `CollateralPoolToken` Factory Contracts
Was this helpful?