Ethereum Credit Guild - Timenov'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: 101/127

Findings: 1

Award: $30.41

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

30.4141 USDC - $30.41

Labels

bug
2 (Med Risk)
satisfactory
sufficient quality report
duplicate-708

External Links

Lines of code

https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/LendingTerm.sol#L323-L330

Vulnerability details

Impact

The last comment in debtCeiling functions states: return min(creditMinterBuffer, hardCap, debtCeiling). However there is an edge case that does not return the smallest of the three parameters.

Proof of Concept

Lets assume the following values:

creditMinterBuffer = 2, _debtCeiling = 3, _hardCap = 1

The first check in line 324 is if (creditMinterBuffer < _debtCeiling). We pass this and the function returns 2.

Tools Used

Manual Review

Add additional checks in the if statements,

        if (creditMinterBuffer < _debtCeiling && creditMinterBuffer < _hardCap) {
            return creditMinterBuffer;
        }
        if (_hardCap < _debtCeiling && _hardCap < creditMinterBuffer) {
            return _hardCap;
        }
        return _debtCeiling;

Assessed type

Math

#0 - c4-pre-sort

2024-01-05T17:12:18Z

0xSorryNotSorry marked the issue as sufficient quality report

#1 - c4-pre-sort

2024-01-05T17:12:38Z

0xSorryNotSorry marked the issue as duplicate of #708

#2 - c4-judge

2024-01-28T19:46:57Z

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