Rubicon contest - Kumpa's results

An order book protocol for Ethereum, built on L2s.

General Information

Platform: Code4rena

Start Date: 23/05/2022

Pot Size: $50,000 USDC

Total HM: 44

Participants: 99

Period: 5 days

Judge: hickuphh3

Total Solo HM: 11

Id: 129

League: ETH

Rubicon

Findings Distribution

Researcher Performance

Rank: 50/99

Findings: 2

Award: $121.12

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: shenwilly

Also found by: 0x52, Kumpa, MiloTruck, pauliax, pedroais, unforgiven

Labels

bug
duplicate
2 (Med Risk)
sponsor acknowledged

Awards

67.7551 USDC - $67.76

External Links

Lines of code

https://github.com/code-423n4/2022-05-rubicon/blob/8c312a63a91193c6a192a9aab44ff980fbfd7741/contracts/rubiconPools/BathPair.sol#L535-L563

Vulnerability details

Without the check on _stratUtil address, malicious strategist could arbitariry add any corrupt address which will cause rebalance() in IBathToken to transfer() filledAsset to that malicious contract. That fake strategistUtility could also create fake function which makes it comply to the interface.

The lack of check could result in the stealing of exceeded assets that cannot get swapped back without incuring the loss during rebalancing.

Right now current strategists need to get approved by the BathHouse which may assure that this exploit will not happen to a certain degree but, in the future, as the project growing, the need for decentralized strategists will rise and the check for the strategist will be the minimum requirement.

proof of concept

1.Malicious strategist creates fake IStrategistUtility with similar function to real IStrategistUtility

2.Malicious strategist input the address of fake IStrategistUtility in _stratUtil of tailOff() in BathPair

3.tailOff() then call rebalance() in the IBathToken

4.rebalance() after calculating stratReward transfer filledAsset to fake IStrategistUtility

5.tailOff() will then call UNIdump() in fake IStrategistUtility, resulting in nothing happening and filledAsset getting stolen.

Mitigation

The contract owner should add some check or whitelist over the external address to make sure that the assets will only be sent to a verified address

#0 - bghughes

2022-06-03T21:50:27Z

Duplicate of #113 #344

#1 - HickupHH3

2022-06-17T02:13:28Z

Duplicate of #157

#2 - HickupHH3

2022-06-17T02:55:32Z

Centralisation risk issue: #344

#3 - HickupHH3

2022-06-21T09:52:19Z

duplicate of #211

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