30922 - [SC - High] DOS of withdrawals through filling the userPoin...
Last updated
Was this helpful?
Last updated
Was this helpful?
Submitted on May 8th 2024 at 07:48:35 UTC by @NinetyNineCrits for
Report ID: #30922
Report type: Smart Contract
Report severity: High
Target: https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/VotingEscrow.sol
Impacts:
Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol)
While not very feasible, it is technically possible to DOS withdraws associated with a tokenId, by doing a large amount of deposits for said tokenId.
Unlike Velodrome, every _checkpoint
call with an associated tokenId writes a new userPoint:
This opens up the door to a DOS, as the number of possible user points is limited:
Any user can invoke _checkpoint
for any tokenId by using depositFor
.
Naturally 1 Billion is a very large number that somewhats limits the feasability and likelihood of this attack (but does not mean a billion transactions need to be made, as the deposits could be looped through a contract). Even though the impact could be categorized as a permanent freeze
, the limitations do not justify a higher severity than medium imo, hence griefing
seems to be the appropriate impact.
DOS of any tokenId, but associated with very high costs of attack.
Consider going back to Velodromes approach of accounting, which limits the addition of points to 1 per block:
This would also add a time constraint on the attack, which would require 380 years, assuming a a block each 12 seconds.
This test will revert on the withdraw
call with: