The Wildcat Protocol - devival'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: 37/131

Findings: 2

Award: $182.26

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: MiloTruck

Also found by: 0xStalin, DarkTower, GREY-HAWK-REACH, InAllHonesty, J4X, YusSecurity, devival

Labels

bug
2 (Med Risk)
downgraded by judge
satisfactory
duplicate-503

Awards

172.0937 USDC - $172.09

External Links

Lines of code

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

Vulnerability details

Impact

According to the docs, the lender that deposits 133.7 XYZ tokens into a market will receive 133.7 market tokens - with the market token name depending on what was selected by the borrower when the market was launched.

However, the above architecture does not handle the case when XYZ is a rebasing (or elastic) token whose supply is algorithmically adjusted. The issue might lead to a permanent loss of funds as tokens would stay locked in the contract.

The issue also breaks the following property: The supply of the market token and assets owed by the borrower should always match.

Proof of Concept

Wildcat-Gitbook#deposits WildcatMarket.sol#L86

Tools Used

Manual Review

  1. You can explicitly state in the documentation that you do not support rebasing mechanism.
  2. Alternatively, when rebasing tokens go down in value, you should have a method to update the market tokens' balances accordingly. And when they go up in value, you should add a method to actually transfer the excess tokens out of the protocol. This is a complex solution.

Assessed type

ERC20

#0 - c4-pre-sort

2023-10-27T09:59:19Z

minhquanym marked the issue as duplicate of #503

#1 - c4-judge

2023-11-07T22:50:42Z

MarioPoneder changed the severity to 2 (Med Risk)

#2 - c4-judge

2023-11-07T22:54:51Z

MarioPoneder marked the issue as satisfactory

Awards

10.1663 USDC - $10.17

Labels

bug
downgraded by judge
grade-b
QA (Quality Assurance)
sponsor disputed
sufficient quality report
Q-12

External Links

Lines of code

https://github.com/code-423n4/2023-10-wildcat/blob/c5df665f0bc2ca5df6f06938d66494b11e7bdada/src/libraries/FeeMath.sol#L45

Vulnerability details

Impact

As mentioned in the previous audit by aleph_v, protocol fees can be bypassed while still paying the same rate to the lenders. The issue was neither resolved nor acknowledged.

Proof of Concept

The overall interest paid by the borrower is the interest times the protocol fee plus any delinquency fees. By setting the delinquency fee percent to the intended interest and then setting the protocol interest percent to zero (or close to zero) the borrower can construct a vault which pays the lenders the same amount of interest via delinquency fees as it would pay via interest. The borrower can increase the liquidity requirements to force payment of persistent delinquency fees. In this case the lenders have no incentive to withdraw as they get the same rate and borrowers pay a net lower fee as no protocol fee is collected. aleph_v, FeeMath.sol#L45

Tools Used

Manual Review

Charge protocol fees on the extra interest which is paid by delinquent loans.

Assessed type

Other

#0 - c4-pre-sort

2023-10-28T17:11:34Z

minhquanym marked the issue as sufficient quality report

#1 - laurenceday

2023-10-31T23:47:15Z

Not a finding, and also quoting something specifically out of scope from a previous review.

#2 - c4-sponsor

2023-10-31T23:47:21Z

laurenceday (sponsor) disputed

#3 - c4-judge

2023-11-07T16:02:28Z

MarioPoneder changed the severity to QA (Quality Assurance)

#4 - MarioPoneder

2023-11-07T16:09:06Z

QA:

  1. Don't see incentive for lender to lose the feature of "real" delinquency. However, it is till possible.
  2. Although, a previous audit report was listed in the README, I cannot see where it was specifically declared out of scope.

#5 - c4-judge

2023-11-09T14:52:51Z

MarioPoneder marked the issue as grade-b

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