Open code423n4 opened 1 year ago
As this is a DOS scenario where funds are not at risk and the chances that rewards are lost forever are low, downgrading to Medium
Picodes changed the severity to 2 (Med Risk)
I agree this is a DOS vector but a continued attack would require the attacker to spend more and more capital. Should be fixed but doesn't pose any risk of material loss.
0xScotch marked the issue as sponsor confirmed
Picodes marked the issue as satisfactory
Lines of code
https://github.com/code-423n4/2023-02-malt/blob/main/contracts/RewardSystem/LinearDistributor.sol#L147-L151 https://github.com/code-423n4/2023-02-malt/blob/main/contracts/RewardSystem/LinearDistributor.sol#L185-L186 https://github.com/code-423n4/2023-02-malt/blob/main/contracts/RewardSystem/LinearDistributor.sol#L123-L136
Vulnerability details
Impact
LinearDistributor.declareReward
will revert and it can cause permanent DOS.Proof of Concept
In
LinearDistributor.declareReward
, if the balance is greater than the bufferRequirement, the rest will be forfeited.And in
_forfeit
, it requires forfeited (= balance - bufferRequirement) <= declaredBalance.So when an attacker sends some collateral tokens to
LinearDistributor
, the balance will be increased and it can cause revert in_forfeit
anddeclareReward
.Since
declareReward
sends vested amount before_forfeit
and the vested amount will be increased by time, so this DOS will be temporary.But if the attacker increases the balance enough to cover all reward amount in vesting,
declareReward
will always revert and it can cause permanent DOS.decrementRewards
updatesdeclaredBalance
, but it only decreasesdeclaredBalance
, so it can't mitigate the DOS.Tools Used
Manual Review
Recommended Mitigation Steps
Track collateral token balance and add sweep logic for unused collateral tokens in
LinearDistributor
.