Ethereum Credit Guild - 0xnev's results

A trust minimized pooled lending protocol.

General Information

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

Ethereum Credit Guild

Findings Distribution

Researcher Performance

Rank: 94/127

Findings: 1

Award: $35.78

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Awards

35.7813 USDC - $35.78

Labels

bug
2 (Med Risk)
downgraded by judge
satisfactory
sufficient quality report
duplicate-966

External Links

Lines of code

https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/main/src/tokens/ERC20RebaseDistributor.sol#L338-L386

Vulnerability details

Impact

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.

Proof of Concept

The malicious distributor can perform the following scenario:

  1. Wait for admin/Lending Term to distribute rewards via distribute(), so existing rebasingSharePrice() is not equal to zero
<br/>
  1. Malicious user can call distribute() 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 respectively

Tools Used

Manual Analysis, Foundry

Recommendation

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.

Assessed type

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

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter