Concur Finance contest - danb's results

Incentives vote-and-rewards sharing protocol

General Information

Platform: Code4rena

Start Date: 03/02/2022

Pot Size: $75,000 USDC

Total HM: 42

Participants: 52

Period: 7 days

Judge: GalloDaSballo

Total Solo HM: 21

Id: 83

League: ETH

Concur Finance

Findings Distribution

Researcher Performance

Rank: 24/52

Findings: 3

Award: $484.53

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Awards

31.0722 USDC - $31.07

Labels

bug
duplicate
3 (High Risk)

External Links

Lines of code

https://github.com/code-423n4/2022-02-concur/blob/main/contracts/Shelter.sol#L52

Vulnerability details

in the withdraw function in Shelter, one can withdraw infinite times, and by doing so, draining the system.

the function doesn't check that the shares aren't already withdrawn.

#1 - GalloDaSballo

2022-04-12T22:19:21Z

Duplicate of #246

Findings Information

🌟 Selected for report: WatchPug

Also found by: CertoraInc, bobi, csanuragjain, danb, hickuphh3, leastwood

Labels

bug
duplicate
3 (High Risk)
sponsor confirmed

Awards

298.6186 USDC - $298.62

External Links

Lines of code

https://github.com/code-423n4/2022-02-concur/blob/main/contracts/MasterChef.sol#L159

Vulnerability details

the user is the user of msg.sender, which is always the StakingRewards contract, instead of _recepient.

one of the problems that are caused by this is that anyone who deposits, will get the rewards of all the other users, because everyone shares the same user (StakingRewards contract address)

Tools Used

discussion with the dev team

change _msgSender() to _recepient in line 159.

#0 - GalloDaSballo

2022-04-17T16:29:18Z

Duplicate of #205

Findings Information

🌟 Selected for report: WatchPug

Also found by: Heartless, danb

Labels

bug
duplicate
2 (Med Risk)
sponsor confirmed

Awards

154.8393 USDC - $154.84

External Links

Lines of code

https://github.com/code-423n4/2022-02-concur/blob/main/contracts/ConvexStakingWrapper.sol#L261 https://github.com/code-423n4/2022-02-concur/blob/main/contracts/ConvexStakingWrapper.sol#L235

Vulnerability details

in the first link I provided, a hacker can call withdraw with amount = 2**196, the amount of shares that will be burned is uint192(2**192) == 0. if the system has enough money, the hacker can steal 2**192 tokens and pay nothing.

for the second link, a user that provides more than 2**192 tokens, the amount of shares they will be truncated and they will get less than they should.

use safe cast of openzeppelin.

#0 - GalloDaSballo

2022-04-19T14:18:55Z

While the warden intuition is correct, the lack of POC makes the finding fall under scrutiny. The casting on the ConvexStakingWrapper is to uint192 however the masterchef contract which will be notified of the withdrawal uses uint128 meaning that the shown POC will revert and won't allow for any value extraction.

If a common denominator between the two where to be found such that _amount was zero in both contracts, then value extraction could happen.

However this POC is not developed enough to sustain this reasoning.

Because of that I'm going to mark this as duplicate of #194 as the casting problem is more developed there

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