The Wildcat Protocol - 0xpiken's results

Banking, but worse - a protocol for fixed-rate, undercollateralised credit facilities.

General Information

Platform: Code4rena

Start Date: 16/10/2023

Pot Size: $60,500 USDC

Total HM: 16

Participants: 131

Period: 10 days

Judge: 0xTheC0der

Total Solo HM: 3

Id: 296

League: ETH

Wildcat Protocol

Findings Distribution

Researcher Performance

Rank: 109/131

Findings: 1

Award: $0.16

🌟 Selected for report: 1

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2023-10-wildcat/blob/main/src/market/WildcatMarketConfig.sol#L134-L144 https://github.com/code-423n4/2023-10-wildcat/blob/main/src/market/WildcatMarket.sol#L142-L161

Vulnerability details

Impact

Without ability to update maxTotalSupply, borrower has no way to raise more asset in specific market. Even worse, borrower has to pay extra interest for unused assets all the time because borrower has no way to reduce the max total supply of the market.

Similarly, borrower has to pay extra interest to the no longer used market all the time because there is no way to close it.

Proof of Concept

There are access controls on function setMaxTotalSupply() and closeMarket() Only WildcatMarketController is allowed to access them. But there is no any function in WildcatMarketController allowing borrower to access them.

Tools Used

Manual review

Add setMaxTotalSupply() and closeMarket() in WildcatMarketController to allow borrower access these functions:

  function setMaxTotalSupply(address market, uint256 _maxTotalSupply) external onlyBorrower {
    WildcatMarket(market).setMaxTotalSupply(_maxTotalSupply);
  }
  function closeMarket(address market) external onlyBorrower {
    WildcatMarket(market).closeMarket();
  }

Assessed type

Access Control

#0 - c4-pre-sort

2023-10-27T06:25:17Z

minhquanym marked the issue as duplicate of #162

#1 - c4-pre-sort

2023-10-27T06:58:19Z

minhquanym marked the issue as duplicate of #147

#2 - c4-judge

2023-11-07T13:50:43Z

MarioPoneder marked the issue as satisfactory

#3 - c4-judge

2023-11-07T14:14:11Z

MarioPoneder marked the issue as selected for report

#5 - laurenceday

2023-11-09T10:37:43Z

Lodging a protest against the High Risk decision, however:

  • Markets could still effectively be closed by all lenders redeeming their market tokens, the borrower handling these repayments ad hoc and the borrower removing all lenders from the appropriate controller to prevent future deposits. No funds are at risk here.
  • The inability to increase or decrease the capacity from the controller - which can lead to more interest accruing to a lender that refuses to withdraw - is not a matter of funds being 'lost' but rather a griefing.

In either case, assets are not at direct risk while in the market: the definition of High Risk as given by the label is 'assets can be stolen/lost/compromised directly'. This does not apply here. It's certainly a Medium, however, and a valuable finding in and of itself.

#6 - MarioPoneder

2023-11-09T17:47:06Z

I partially agree with the sponsor. However, if the protocol was deployed with this bug, it would lack 2 core functionalities. A protocol being fully functional as intended, which is crucial to attract and keep customers/users with funds in the long term, can be considered a valuable asset itself. Although Medium severity is predestined for this category of findings which impede the function of a protocol, High severity seems justified given the impact.

The following might further clarify my reasoning:
Please also consider that not all findings that lead to lost or stolen funds will strictly yield a High severity finding, since it depends on the amount of funds at risk.
In contrast, not every impeded functionality will only yield Medium severity.

Further info for wardens: Duplicates that found only 1 of the 2 instances of the present issue are awarded with partial-50.

#7 - laurenceday

2023-11-14T17:26:29Z

Fair enough - not going to throw toys out of the pram over semantics. Appreciate the feedback!

#8 - c4-sponsor

2023-11-14T17:26:36Z

laurenceday (sponsor) confirmed

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