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: 94/127
Findings: 1
Award: $35.78
🌟 Selected for report: 0
🚀 Solo Findings: 0
35.7813 USDC - $35.78
Lack of access control in ERC20RebaseDistributor.distribute()
here allows anybody to reset the state variables __rebasingSharePrice
and _unmintedRebaseRewards
, more specifically, it extends lastTimeStamp
and targetTimestamp
, effectively reducing the elasped
within ERC20RebaseDistributor.interpolatedValue()
.
A malicious user can front run call to first distribute/subsequent distributes by admin by indefinitely calling distribute
with a very small amount of credit tokens (e.g. 1e-18 gUSDC, represented by 1) to reduce linearly interpolated rewards for users. The increase in share price would be so small that there could be no/minimal change to newTargetSharePrice
, but the lastTimeStamp
and targetTimestamp
has already been extended in __rebasingSharePrice
and _unmintedRebaseRewards
.
This will inturn affect computation of rebasingSharePrice()
and unmintedRebaseRewards()
, by reducing the interpolation period for the above parameters delta
, which in turn reduces rewards of users in spite of them being subscribed to the savings plan for the fixed period of time.
The malicious distributor can perform the following scenario:
distribute()
, so existing rebasingSharePrice()
is not equal to zerodistribute()
with just 1 wei, reducing interpolation period for delta
represented by elapsed
and targetTimeStamp
in interpolatedValue()
the computations here due to extension in lastTimestamp
and targetTimestamp
here and here respectivelyManual Analysis, Foundry
distribute
should have relevant access control to only allow an admin to distribute interest earned for rebasing mechanism from lending term or any source at appropriate timings.
Access Control
#0 - c4-pre-sort
2024-01-02T17:45:19Z
0xSorryNotSorry marked the issue as sufficient quality report
#1 - c4-pre-sort
2024-01-02T17:45:53Z
0xSorryNotSorry marked the issue as duplicate of #1100
#2 - c4-judge
2024-01-29T22:00:00Z
Trumpero changed the severity to 2 (Med Risk)
#3 - c4-judge
2024-01-29T22:04:02Z
Trumpero marked the issue as satisfactory