Streaming Protocol contest - gzeon's results

General Information

Platform: Code4rena

Start Date: 30/11/2021

Pot Size: $100,000 USDC

Total HM: 15

Participants: 36

Period: 7 days

Judge: 0xean

Total Solo HM: 4

Id: 62

League: ETH

Streaming Protocol

Findings Distribution

Researcher Performance

Rank: 14/36

Findings: 5

Award: $2,539.33

🌟 Selected for report: 3

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: WatchPug

Also found by: 0x0x0x, ScopeLift, gpersoon, gzeon, harleythedog, hyh, jonah1005, kenzo

Labels

bug
duplicate
3 (High Risk)

Awards

385.4189 USDC - $385.42

External Links

Handle

gzeon

Vulnerability details

Impact

In recoverTokens, when token == depositToken, the excess is defined as follow

excess = ERC20(token).balanceOf(address(this)) - (depositTokenAmount - redeemedDepositTokens);

Instead we should also consider depositTokenFlashloanFeeAmount gained from flashloan fee

Proof of Concept

https://github.com/code-423n4/2021-11-streaming/blob/56d81204a00fc949d29ddd277169690318b36821/Streaming/src/Locke.sol#L654

excess = ERC20(token).balanceOf(address(this)) - (depositTokenAmount + depositTokenFlashloanFeeAmount - redeemedDepositTokens);

#0 - 0xean

2022-01-14T20:44:30Z

duplicate of #241

Findings Information

🌟 Selected for report: cmichel

Also found by: 0x0x0x, Ruhum, gpersoon, gzeon, hack3r-0m, pauliax

Labels

bug
duplicate
3 (High Risk)

Awards

611.7761 USDC - $611.78

External Links

Handle

gzeon

Vulnerability details

Impact

There doesn't seems to be anything to prevent one the deploy a Stream with rewardToken == depositToken. If rewardToken == depositToken, some logic might be broken.

Proof of Concept

For example,

  1. recoverTokens logic would be broken because it does not calculate excess properly. https://github.com/code-423n4/2021-11-streaming/blob/56d81204a00fc949d29ddd277169690318b36821/Streaming/src/Locke.sol#L646 the correct excess would be
excess := balance + redeemedDepositTokens - rewardTokenFeeAmount - depositTokenFlashloanFeeAmount - depositTokenAmount - rewardTokenAmount
  1. flashloan would accounted all fee to depositTokenFlashloanFeeAmount

Handle these case or make sure rewardToken != depositToken

#0 - 0xean

2022-01-14T21:04:33Z

dupe of #215

Findings Information

🌟 Selected for report: toastedsteaksandwich

Also found by: Meta0xNull, Omik, ScopeLift, bitbopper, gzeon, pedroais, wuwe1

Labels

bug
duplicate
3 (High Risk)

Awards

481.7736 USDC - $481.77

External Links

Handle

gzeon

Vulnerability details

Impact

arbitraryCall did not check the balances of incentives, which allow inherited governance to steal the incentives.

Proof of Concept

https://github.com/code-423n4/2021-11-streaming/blob/56d81204a00fc949d29ddd277169690318b36821/Streaming/src/Locke.sol#L733

Keep track of incentive token addresses in createIncentive and check the balance of each token before and after the arbitrary call to ensure trustlessness

#0 - brockelmore

2021-12-08T23:10:03Z

@ judges, this report is lacking the actual functionality to do so - i am inclined to dispute this particular report to reward those that actually provided PoC.

#1 - 0xean

2022-01-14T22:00:13Z

@brockelmore - it is certainly light on the details, but does recommend a mitigation. I am going to leave it as a duplicate, but appreciate the sentiment that is would be hard if other's hadn't reported this issue to be sure of the vulnerability.

#2 - 0xean

2022-01-14T22:00:27Z

dupe of #199

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