Sturdy contest - leastwood's results

The first protocol for interest-free borrowing and high yield lending.

General Information

Platform: Code4rena

Start Date: 13/05/2022

Pot Size: $30,000 USDC

Total HM: 8

Participants: 65

Period: 3 days

Judge: hickuphh3

Total Solo HM: 1

Id: 125

League: ETH

Sturdy

Findings Distribution

Researcher Performance

Rank: 10/65

Findings: 2

Award: $1,376.01

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Findings Information

🌟 Selected for report: IllIllI

Also found by: StErMi, leastwood

Labels

bug
duplicate
2 (Med Risk)

Awards

1008.4359 USDC - $1,008.44

External Links

Lines of code

https://github.com/code-423n4/2022-05-sturdy/blob/main/smart-contracts/ConvexCurveLPVault.sol#L87-L111

Vulnerability details

Impact

The ConvexCurveLPVault.sol contract allows users to earn a yield on curve token deposits. Rewards are paid out in native CRV and CVX tokens but the reward manager of the base pool may opt to add extra rewards. Because the reward manager has the ability to extend the list of extra rewards, they can extend it such that the processYield() function is unable to execute within a single block. As a result, the protocol effectively loses out on all yield accrued by user's deposits. This yield is forever locked in the contract as the yield is never transferred out from the vault contract.

Consider restricting the number of extra rewards by only iterating through the first X number of tokens in processYield().

#0 - sforman2000

2022-05-18T02:33:42Z

Findings Information

🌟 Selected for report: mtz

Also found by: 0x52, hyh, jonah1005, leastwood, sorrynotsorry

Labels

bug
duplicate
2 (Med Risk)
disagree with severity

Awards

367.5749 USDC - $367.57

External Links

Lines of code

https://github.com/code-423n4/2022-05-sturdy/blob/main/smart-contracts/YieldManager.sol#L118-L137

Vulnerability details

Impact

processYield() restricts who can call this function to just the vault admin. Upon being processed, the treasury receives its fair share of the yield and the rest is transferred to the YieldManager.sol contract. To distribute yield, the manager calls distributeYield() to swap all reward tokens to the exchange token before depositing the yield into the lending pool.

A user can front-run this distribute action by depositing their funds into the pool, and then subsequently withdrawing their funds from the protocol after distribution. The user is rewarded for taking no risk in the protocol and they have effectively diluted the yield allocation to honest depositors of the protocol.

Ensure that distributions are weighted according to deposit duration. It may be useful to utilise some streaming contract which is funded by yield distributions but actually spreads this yield over a number of blocks.

#0 - sforman2000

2022-05-18T02:44:11Z

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