Sherlock contest - jonah1005's results

Decentralized exploit protection.

General Information

Platform: Code4rena

Start Date: 22/07/2021

Pot Size: $80,000 USDC

Total HM: 6

Participants: 14

Period: 7 days

Judge: ghoulsol

Total Solo HM: 3

Id: 21

League: ETH

Sherlock

Findings Distribution

Researcher Performance

Rank: 7/14

Findings: 2

Award: $3,699.70

🌟 Selected for report: 1

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: hrkrshnn

Also found by: jonah1005, walker

Labels

bug
duplicate
3 (High Risk)

Awards

3366.2338 USDC - $3,366.23

External Links

Handle

jonah1005

Vulnerability details

Impact

In PoolOpen contract, pools' authentication is done through baseData. However, it handles token transfer based on the given parameter token. By appending a real token address at the end of the transaction and a fake address in the function parameter, attackers can stake an unlimited amount.

Proof of Concept

A simple exploit would be:

data = sherlock.encodeABI(fn_name='stake', args = [1*10**18, w3.eth.accounts[0], fake_token.address])
w3.eth.send_transaction({'from': admin, 'to': sherlock.address, 'data': data+dai.address[2:]})

baseData queries dai's pool while the contract charges the user's fakeToken

Tools Used

hardhat

The usage of baseData() is dangerous. The little benefit of gas efficiency comes with great cost in readibility. I recommend the dev using standard solidity.

PoolStrategy, PoolBase, and PoolOpen use the same pattern. There's should be a few exploits in these contracts. Since the root cause is similar, I skip those issues in order to not spam the system. I recommend the team check all these contracts if baseData is needed.

#0 - Evert0x

2021-07-30T14:49:51Z

#90

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