Sandclock contest - ye0lde's results

The Next Generation of Wealth Creation.

General Information

Platform: Code4rena

Start Date: 06/01/2022

Pot Size: $60,000 USDC

Total HM: 20

Participants: 33

Period: 7 days

Judge: LSDan

Total Solo HM: 9

Id: 67

League: ETH

Sandclock

Findings Distribution

Researcher Performance

Rank: 29/33

Findings: 2

Award: $90.06

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: camden

Also found by: Ruhum, WatchPug, cccz, cmichel, danb, defsec, harleythedog, hyh, kenzo, leastwood, palina, pauliax, pmerkleplant, ye0lde

Labels

bug
duplicate
3 (High Risk)
sponsor strategy

Awards

90.0579 USDC - $90.06

External Links

Handle

ye0lde

Vulnerability details

Impact

Since the code does not use a minimum return value for swaps it is susceptible to sandwich attacks. More information here: https://cmichel.io/de-fi-sandwich-attacks/

Proof of Concept

Here the code Calls Curve to convert the existing underlying balance into UST: https://github.com/code-423n4/2022-01-sandclock/blob/a90ad3824955327597be00bb0bd183a9c228a4fb/sandclock/contracts/strategy/NonUSTStrategy.sol#L71-L85

/** * Calls Curve to convert the existing underlying balance into UST */ function _swapUnderlyingToUst() internal { uint256 underlyingBalance = _getUnderlyingBalance(); if (underlyingBalance > 0) { // slither-disable-next-line unused-return curvePool.exchange_underlying( underlyingI, ustI, underlyingBalance, 0 ); } }

It does not specify the minimum amount of UST to receive at line 82.

A similar problem occurs here: https://github.com/code-423n4/2022-01-sandclock/blob/a90ad3824955327597be00bb0bd183a9c228a4fb/sandclock/contracts/strategy/NonUSTStrategy.sol#L94

Tools Used

Visual Studio Code, Remix

Add minimum return amount checks.

#0 - naps62

2022-01-18T13:19:31Z

duplicate of #7

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