Wise Lending - Mrxstrange's results

Decentralized liquidity market that allows users to supply crypto assets and start earning a variable APY from borrowers.

General Information

Platform: Code4rena

Start Date: 21/02/2024

Pot Size: $200,000 USDC

Total HM: 22

Participants: 36

Period: 19 days

Judge: Trust

Total Solo HM: 12

Id: 330

League: ETH

Wise Lending

Findings Distribution

Researcher Performance

Rank: 29/36

Findings: 1

Award: $249.82

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: serial-coder

Also found by: 0x11singh99, Jorgect, Mrxstrange, Rhaydden, josephdara, nonseodion, unix515

Labels

bug
2 (Med Risk)
sufficient quality report
satisfactory
duplicate-245

Awards

249.8161 USDC - $249.82

External Links

Lines of code

https://github.com/code-423n4/2024-02-wise-lending/blob/79186b243d8553e66358c05497e5ccfd9488b5e2/contracts/TransferHub/CallOptionalReturn.sol#L19-L33 https://github.com/code-423n4/2024-02-wise-lending/blob/79186b243d8553e66358c05497e5ccfd9488b5e2/contracts/WiseLending.sol#L796

Vulnerability details

Discriptipon

  • withdraw privately deposited ERC20 funds is used throughout the code via _safeTransfer() function in WiseLending.sol L-781 . According to Solidity Docs the call may return true even if it was a failure. This may result in user funds lost because funds were transferred into this contract in preparation for the withdrawal. The withdraw fails but doesn’t revert. There is a way this can happen through WiseLending.sol due to a missing require that is present in the other facets which is a separate issue but gives this issue more relevance.

Proof of Concept

  1. Alice withdraw ERC20 funds
  2. Alice’s are sent to the WiseLending.sol contract
  3. The call on solelyWithdraw() -> _safeTransfer() -> _callOptionalReturn(_token,abi.encodeWithSelector(IERC20.transfer.selector,_to,_value));; fails but returns success due to nonexisting contract
  4. Alice receives nothing in return

There are 3 instances of this issue:

https://github.com/code-423n4/2024-02-wise-lending/blob/79186b243d8553e66358c05497e5ccfd9488b5e2/contracts/WiseLending.sol#L738 https://github.com/code-423n4/2024-02-wise-lending/blob/79186b243d8553e66358c05497e5ccfd9488b5e2/contracts/WiseLending.sol#L889 https://github.com/code-423n4/2024-02-wise-lending/blob/79186b243d8553e66358c05497e5ccfd9488b5e2/contracts/WiseLending.sol#L926
  • Check for contract existence.

A similar issue was awarded a medium here.

https://github.com/code-423n4/2022-01-trader-joe-findings/issues/170

Assessed type

Access Control

#0 - c4-pre-sort

2024-03-17T14:30:38Z

GalloDaSballo marked the issue as duplicate of #212

#1 - c4-pre-sort

2024-03-18T16:27:15Z

GalloDaSballo marked the issue as sufficient quality report

#2 - c4-judge

2024-03-26T14:32:16Z

trust1995 marked the issue as partial-50

#3 - c4-judge

2024-03-26T14:32:20Z

trust1995 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