The Wildcat Protocol - stackachu'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: 77/131

Findings: 2

Award: $16.72

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

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

Vulnerability details

Impact

The inability to close markets has the following consequences:

  • Excess assets in the market (e.g. sent to the market in excess of the required payment by the borrower) cannot be recovered as closing a market is the only way to transfer excess assets out of the market. This causes those assets to be stuck in the market forever.
  • If the interest rate constraints were enforced by the controller, the borrower might be forced to pay interest on assets that the borrower no longer wants to utilize but that are not withdrawn by the lender(s) (in the current version of the code the borrower can change the market's interest rate to 0% via the controller, however I believe that this is a bug and that the interest rate constraints are supposed to be applied, which would make the borrower unable the change the interest rate below the minimum interest rate).

Proof of Concept

The WildcatMarket.closeMarket() function has the onlyController modifier. Thus, it can only be called by the controller. The controller, however, has no code to call this function, making it effectively uncallable.

function closeMarket() external onlyController nonReentrant {

Tools Used

Manual review.

A closeMarket() function should be added to WildcatMarketController that is callable by the borrower and calls the WildcatMarket.closeMarket() function to close a market.

Assessed type

Other

#0 - c4-pre-sort

2023-10-27T07:25:28Z

minhquanym marked the issue as duplicate of #147

#1 - c4-judge

2023-11-07T14:05:57Z

MarioPoneder marked the issue as partial-50

#2 - c4-judge

2023-11-07T14:16:53Z

MarioPoneder changed the severity to 3 (High Risk)

Awards

16.6643 USDC - $16.66

Labels

2 (Med Risk)
satisfactory
duplicate-196

External Links

Judge has assessed an item in Issue #601 as 2 risk. The relevant finding follows:

[L-01] Interest rate constraints are not enforced when market interest rate is changed

#0 - c4-judge

2023-11-09T15:21:35Z

MarioPoneder marked the issue as duplicate of #196

#1 - c4-judge

2023-11-09T15:21:41Z

MarioPoneder 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