Inverse Finance contest - jayphbee'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: 19/127

Findings: 1

Award: $445.87

🌟 Selected for report: 1

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: jayphbee

Also found by: catchup, cccz, corerouter, trustindistrust

Labels

bug
2 (Med Risk)
primary issue
satisfactory
sponsor confirmed
selected for report
M-06

Awards

445.8654 USDC - $445.87

External Links

Lines of code

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

Vulnerability details

Impact

User can free from liquidation fee if its escrow balance less than the calculated liquidation fee.

Proof of Concept

If the liquidationFeeBps is enabled, the gov should receive the liquidation fee. But if user's escrow balance is less than the calculated liquidation fee, gov got nothing. https://github.com/code-423n4/2022-10-inverse/blob/main/src/Market.sol#L605-L610

        if(liquidationFeeBps > 0) {
            uint liquidationFee = repaidDebt * 1 ether / price * liquidationFeeBps / 10000;
            if(escrow.balance() >= liquidationFee) {
                escrow.pay(gov, liquidationFee);
            }
        }

Tools Used

manual review

User should pay all the remaining escrow balance if the calculated liquidation fee is greater than its escrow balance.

        if(liquidationFeeBps > 0) {
            uint liquidationFee = repaidDebt * 1 ether / price * liquidationFeeBps / 10000;
            if(escrow.balance() >= liquidationFee) {
                escrow.pay(gov, liquidationFee);
            } else {
                escrow.pay(gov, escrow.balance());
            }
        }

#0 - 0xean

2022-11-05T21:09:57Z

this should amount to dust.

#1 - c4-judge

2022-11-05T21:10:05Z

0xean marked the issue as primary issue

#2 - c4-sponsor

2022-11-09T04:21:40Z

08xmt marked the issue as sponsor confirmed

#3 - 08xmt

2022-11-09T04:22:27Z

#4 - c4-judge

2022-11-28T19:35:27Z

0xean marked the issue as satisfactory

#5 - c4-judge

2022-12-01T15:59:26Z

0xean marked the issue as selected for report

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