Rubicon contest - 0x52'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: 24/99

Findings: 2

Award: $458.12

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: xiaoming90

Also found by: 0x52, PP1004, sashik_eth, shenwilly

Labels

bug
duplicate
3 (High Risk)

Awards

390.3586 USDC - $390.36

External Links

Lines of code

https://github.com/code-423n4/2022-05-rubicon/blob/8c312a63a91193c6a192a9aab44ff980fbfd7741/contracts/rubiconPools/BathToken.sol#L629-L653

Vulnerability details

Impact

Vested rewards from BathBuddy can be stolen

Proof of Concept

Each time withdraw() is called the following lines are used to determine the reward for the given withdraw:

https://github.com/code-423n4/2022-05-rubicon/blob/8c312a63a91193c6a192a9aab44ff980fbfd7741/contracts/rubiconPools/BathToken.sol#L642-L648

This means that if 10% of outstanding shares are withdrawn, then 10% of the vested rewards are also distributed. An attacker could deposit assets to obtain shares then immediately call withdraw to receive rewards from BathBuddy and their initial deposit back from BathToken. They can then deposit the same assets again and keep repeating the cycle until all vested rewards have been drained from BathBuddy.

Tools Used

A mapping should be implement to track when a user deposited tokens and make vesting reliant on both the time and amount deposited

#0 - bghughes

2022-06-03T23:33:35Z

Duplicate of #109 #450 #283

#1 - HickupHH3

2022-06-18T06:43:55Z

Duplicate of #109

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

Submitting as medium risk bug because it would have to be a whitelisted strategist

Impact

Malicious strategist can steal all user funds

Proof of Concept

TailOff allows strategist to specify both the minimum out and the contract responsible for swapping tokens. Malicious/compromised strategist can easily steal all user funds in contract by referencing malicious _stratUtil and 0 for the hurdle amount or by sandwich attack on legitimate _stratUtil and hurdle of 0

Tools Used

Limit _stratUtil to whitelisted contract and implement a slippage limit

#0 - bghughes

2022-06-03T21:51:08Z

Strategists are assumed trusted in the current centralized system

#1 - HickupHH3

2022-06-23T14:10:17Z

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