Inverse Finance contest - catchup's results

Rethink the way you borrow.

General Information

Platform: Code4rena

Start Date: 25/10/2022

Pot Size: $50,000 USDC

Total HM: 18

Participants: 127

Period: 5 days

Judge: 0xean

Total Solo HM: 9

Id: 175

League: ETH

Inverse Finance

Findings Distribution

Researcher Performance

Rank: 25/127

Findings: 3

Award: $376.98

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: jayphbee

Also found by: catchup, cccz, corerouter, trustindistrust

Labels

bug
2 (Med Risk)
satisfactory
duplicate-275

Awards

342.9734 USDC - $342.97

External Links

Lines of code

https://github.com/code-423n4/2022-10-inverse/blob/main/src/Market.sol#L605-L610

Vulnerability details

Impact

When a user debt is liquidated, if the escrow balance is less than the liquidation fee, no fee is paid.

605: if(liquidationFeeBps > 0) { 606: uint liquidationFee = repaidDebt * 1 ether / price * liquidationFeeBps / 10000; 607: if(escrow.balance() >= liquidationFee) { 608: escrow.pay(gov, liquidationFee); 609: } 610: }

However, escrow balance can be deducted as liquidation fee in that case. Governance is missing out on the fees it can collect.

Tools Used

Manual review

Change the above code block as:

605: if(liquidationFeeBps > 0) { 606: uint liquidationFee = repaidDebt * 1 ether / price * liquidationFeeBps / 10000; 607: if(escrow.balance() >= liquidationFee) { 608: escrow.pay(gov, liquidationFee); 609: } 610: else { 611: escrow.pay(gov, escrow.balance()); 612: } 613: }

#0 - c4-judge

2022-11-05T21:10:16Z

0xean marked the issue as duplicate

#1 - Simon-Busch

2022-12-05T15:35:12Z

Issue marked as satisfactory as requested by 0xean

Findings Information

Awards

33.634 USDC - $33.63

Labels

bug
2 (Med Risk)
satisfactory
duplicate-301

External Links

Lines of code

https://github.com/code-423n4/2022-10-inverse/blob/main/src/DBR.sol#L78-L84 https://github.com/code-423n4/2022-10-inverse/blob/main/src/DBR.sol#L349-L352

Vulnerability details

Impact

The operator can add as many minter addresses as he/she wants.

81: function addMinter(address minter_) public onlyOperator { 82: minters[minter_] = true; //@audit-issue medium unlimited number of minters can be added. centralisation risk. a compromised minter can overinflate the DBR. 83: emit AddMinter(minter_); 84: }

I believe this presents an important risk as if one of these minter addresses is compromised, unlimited number of DBR can be minted.

Tools Used

Manual review

Consider giving the minter role to only the operator, or have just a single minter rather than multiple.

#0 - c4-judge

2022-11-05T21:31:28Z

0xean marked the issue as duplicate

#1 - Simon-Busch

2022-12-05T15:36:04Z

Issue marked as satisfactory as requested by 0xean

#2 - c4-judge

2022-12-07T08:22:04Z

Simon-Busch marked the issue as duplicate of #301

Lines of code

https://github.com/code-423n4/2022-10-inverse/blob/main/src/Oracle.sol#L6 https://github.com/code-423n4/2022-10-inverse/blob/main/src/Oracle.sol#L82 https://github.com/code-423n4/2022-10-inverse/blob/main/src/Oracle.sol#L16

Vulnerability details

Impact

The Chainlink API latestAnswer used in Oracle.sol is deprecated. Please check the link. This function returns 0 when there is no data rather than giving out error. Also Chainlink may stop supporting the deprecated API one day. In that case prices will not be able to be obtained.

Tools Used

Manual review

Use the latestRoundData function to get the price instead. Add checks on the return data with proper revert messages if the price is stale or the round is uncomplete, for example:

(uint80 roundID, int256 price, , uint256 timeStamp, uint80 answeredInRound) = priceOracle.latestRoundData(); require(answeredInRound >= roundID, "..."); require(timeStamp != 0, "...");

#0 - neumoxx

2022-10-31T08:45:38Z

Duplicate of #601

#1 - c4-judge

2022-11-05T17:50:15Z

0xean marked the issue as duplicate

#2 - Simon-Busch

2022-12-05T15:27:17Z

Issue marked as satisfactory as requested by 0xean

#3 - c4-judge

2022-12-07T08:14:13Z

Simon-Busch marked the issue as duplicate of #584

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