The Wildcat Protocol - crunch'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: 52/131

Findings: 2

Award: $91.30

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

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

Vulnerability details

Impact

There is no way to close a market.

Proof of Concept

function closeMarket() is defined in contract WildcatMarket to close a market.

This function is only callable by market controller.

function closeMarket() external onlyController nonReentrant {

Unfortunately, there is no code calls function closeMarket() in WildcatMarketController contract.

So there is no way to close a market.

Tools Used

Manual Review

function closeMarket() should be callable by the borrower.

- function closeMarket() external onlyController nonReentrant { + function closeMarket() external onlyBorrower nonReentrant {

Assessed type

Access Control

#0 - c4-pre-sort

2023-10-27T07:06:26Z

minhquanym marked the issue as duplicate of #147

#1 - c4-judge

2023-11-07T13:53:20Z

MarioPoneder changed the severity to 2 (Med Risk)

#2 - c4-judge

2023-11-07T13:59:22Z

MarioPoneder marked the issue as partial-50

#3 - c4-judge

2023-11-07T14:16:53Z

MarioPoneder changed the severity to 3 (High Risk)

Findings Information

🌟 Selected for report: osmanozdemir1

Also found by: 0xCiphky, 0xStalin, HChang26, Infect3d, Jiamin, Juntao, QiuhaoLi, circlelooper, crunch, rvierdiiev

Labels

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

Awards

91.2409 USDC - $91.24

External Links

Lines of code

https://github.com/code-423n4/2023-10-wildcat/blob/c5df665f0bc2ca5df6f06938d66494b11e7bdada/src/market/WildcatMarketConfig.sol#L74-L81

Vulnerability details

Impact

When a lender is nuked from orbit, his/her supply still accrues interest.

Proof of Concept

When a lender is nuked from orbit by calling function nukeFromOrbit(address accountAddress), function _blockAccount(state, accountAddress) will be called to block the lender:

function nukeFromOrbit(address accountAddress) external nonReentrant { if (!IWildcatSanctionsSentinel(sentinel).isSanctioned(borrower, accountAddress)) { revert BadLaunchCode(); } MarketState memory state = _getUpdatedState(); _blockAccount(state, accountAddress); _writeState(state); }

A blocked lender's scaledBalance becomes 0, means no interest will be accrued to this lender:

function _blockAccount(MarketState memory state, address accountAddress) internal { Account memory account = _accounts[accountAddress]; if (account.approval != AuthRole.Blocked) { uint104 scaledBalance = account.scaledBalance; account.approval = AuthRole.Blocked; emit AuthorizationStatusUpdated(accountAddress, AuthRole.Blocked); if (scaledBalance > 0) { account.scaledBalance = 0; address escrow = IWildcatSanctionsSentinel(sentinel).createEscrow( accountAddress, borrower, address(this) ); emit Transfer(accountAddress, escrow, state.normalizeAmount(scaledBalance)); _accounts[escrow].scaledBalance += scaledBalance; emit SanctionedAccountAssetsSentToEscrow( accountAddress, escrow, state.normalizeAmount(scaledBalance) ); } _accounts[accountAddress] = account; } }

However, this function does not update market state's scaledTotalSupply, the lender's supply still accrues interest.

Tools Used

Manual Review

When a lender is nuked from orbit, his/her supply should cease to accrue interest

Assessed type

Access Control

#0 - c4-pre-sort

2023-10-27T14:48:49Z

minhquanym marked the issue as duplicate of #123

#1 - c4-judge

2023-11-07T18:14:28Z

MarioPoneder changed the severity to 2 (Med Risk)

#2 - c4-judge

2023-11-07T18:14:33Z

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