Wild Credit contest - jonah1005's results

Decentralized lending protocol with isolated lending pairs.

General Information

Platform: Code4rena

Start Date: 08/07/2021

Pot Size: $50,000 USDC

Total HM: 7

Participants: 13

Period: 7 days

Judge: ghoulsol

Total Solo HM: 5

Id: 18

League: ETH

Wild Credit

Findings Distribution

Researcher Performance

Rank: 11/13

Findings: 3

Award: $429.51

🌟 Selected for report: 1

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: jonah1005

Also found by: 0xRajeev, JMukesh, cmichel, shw

Labels

bug
2 (Med Risk)
sponsor confirmed

Awards

360.7268 USDC - $360.73

External Links

Handle

jonah1005

Vulnerability details

Impact

A non standard erc20 token would always raise error when calling _safeTransferFrom. If a user creates a USDT/DAI pool and deposit into the pool he would find out there's never a counterpart deposit.

Proof of Concept

https://github.com/code-423n4/2021-07-wildcredit/blob/82c48d73fd27a9d4d5d4a395b3affcef4ef6c5c8/contracts/TransferHelper.sol#L19

TransferHelper does not uses SafeERC20 library as the function name implies.

A sample POC: script:

usdt.functions.approve(lending_pair.address, deposit_amount).transact({'from': w3.eth.accounts[0]}) lending_pair.functions.deposit(w3.eth.accounts[0], usdt.address, deposit_amount).transact({'from': w3.eth.accounts[0]})

Error Message:

Error: Transaction reverted: function returned an unexpected amount of data at LendingPair._safeTransferFrom (contracts/TransferHelper.sol:20) at LendingPair.deposit (contracts/LendingPair.sol:95)

Tools Used

Hardhat

Uses openzeppelin SafeERC20 in transfer helper (and any other contract that uses IERC20).

#0 - ghoul-sol

2021-08-01T20:58:09Z

This can effect deposits so it's a medium risk.

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