Platform: Code4rena
Start Date: 11/12/2023
Pot Size: $90,500 USDC
Total HM: 29
Participants: 127
Period: 17 days
Judge: TrungOre
Total Solo HM: 4
Id: 310
League: ETH
Rank: 96/127
Findings: 1
Award: $35.78
🌟 Selected for report: 0
🚀 Solo Findings: 0
35.7813 USDC - $35.78
Malicious actors can exploit the distribute function in the CreditToken
contract to indefinitely delay the complete distribution of credit rewards to users participating in rebasing.
In the current implementation of the CreditToken
contract, the distribute function is publicly accessible, allowing any user to trigger the distribution
of tokens to rebasing accounts. The distribution's end timestamp is set to block.timestamp + DISTRIBUTION_PERIOD
, with DISTRIBUTION_PERIOD
being 30 days.
if (_rebasingSupply != 0) { // update rebasingSharePrice interpolation uint256 endTimestamp = block.timestamp + DISTRIBUTION_PERIOD;
A malicious user can repeatedly call the distribute function with a minimal amount (e.g., 1 wei). Each call extends the distribution period by an additional 30 days. By doing this continually, the malicious user can effectively prolong the distribution indefinitely. This action not only delays the reward distribution but also gradually decreases the rate of distribution, adversely affecting users who have entered rebasing.
For example, a scenario where the total reward pool is 300e18 tokens, intended to be distributed evenly over 30 days, which amounts to 10e18 tokens per day. At day 15th, there should be another 15 days left to distribute the remaining 150e18 tokens at the rate of 10e18 tokens per day. The malicious user call distribute
with 1 wei, the total rewards is 150e18 + 1 wei and resets the distribution period to another 30 days. It means that the rate is now 5e18 per day. As we can see the rate is reduce significant (50%).
Manual
Restrict the access to the distribute function by allowing only specific roles or authorized accounts to execute this function.
DoS
#0 - c4-pre-sort
2024-01-03T21:02:02Z
0xSorryNotSorry marked the issue as sufficient quality report
#1 - c4-pre-sort
2024-01-03T21:02:27Z
0xSorryNotSorry marked the issue as duplicate of #1100
#2 - c4-judge
2024-01-29T22:05:05Z
Trumpero marked the issue as satisfactory