Sushi Trident contest phase 2 - pauliax's results

Community-driven DeFi platform

General Information

Platform: Code4rena

Start Date: 30/09/2021

Pot Size: $100,000 SUSHI

Total HM: 24

Participants: 7

Period: 7 days

Judge: alcueca

Total Solo HM: 16

Id: 35

League: ETH

Sushi

Findings Distribution

Researcher Performance

Rank: 6/7

Findings: 7

Award: $6,904.79

🌟 Selected for report: 6

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: broccoli

Also found by: 0xsanson, cmichel, hickuphh3, pauliax

Labels

bug
duplicate
3 (High Risk)
sponsor confirmed

Awards

49.5711 SUSHI - $619.64

External Links

Handle

pauliax

Vulnerability details

Impact

Should be incentiveId, not positionId here: Incentive memory incentive = incentives[pool][positionId];

Incentive memory incentive = incentives[pool][incentiveId];

#0 - sarangparikh22

2021-10-12T10:06:20Z

Duplicate of #39

Findings Information

🌟 Selected for report: cmichel

Also found by: WatchPug, broccoli, hickuphh3, pauliax

Labels

bug
duplicate
3 (High Risk)
sponsor confirmed

Awards

49.5711 SUSHI - $619.64

External Links

Handle

pauliax

Vulnerability details

Impact

function reclaimIncentive can be invoked more than once for the same incentiveId. If there were multiple incentives for the same token it would allow to drain these tokens by repeatedly calling reclaimIncentive.

Simple mitigation is to simply add the amount to the rewardsUnclaimed or add an extra boolean flag 'reclaimed' to the Incentive struct but that would incur more gas.

#0 - sarangparikh22

2021-10-11T14:01:41Z

Duplicate of #37

Findings Information

🌟 Selected for report: cmichel

Also found by: 0xsanson, broccoli, pauliax

Labels

bug
duplicate
3 (High Risk)
sponsor confirmed

Awards

68.8487 SUSHI - $860.61

External Links

Handle

pauliax

Vulnerability details

Impact

function burn should subtract amount0 and amount1, not only fees from reserve0 and reserve1 here as whole amounts are withdrawn: reserve0 -= uint128(amount0fees); reserve1 -= uint128(amount1fees);

reserve0 -= uint128(amount0); reserve1 -= uint128(amount1);

#0 - sarangparikh22

2021-10-12T10:25:45Z

Duplicate of #51

Findings Information

🌟 Selected for report: cmichel

Also found by: pauliax

Labels

bug
duplicate
2 (Med Risk)
sponsor disputed

Awards

50.999 SUSHI - $637.49

External Links

Handle

pauliax

Vulnerability details

Impact

function addIncentive does not verify secondsClaimed so any arbitrary value can be set initially by the creator and it may break calculations.

Consider either requiring that incentive.secondsClaimed is 0 or manually resetting it upon creation.

#0 - sarangparikh22

2021-10-12T10:10:33Z

Duplicate of #42, Disagree with severity, it should be 1.

Findings Information

🌟 Selected for report: cmichel

Also found by: pauliax

Labels

bug
duplicate
2 (Med Risk)
sponsor confirmed
disagree with severity

Awards

50.999 SUSHI - $637.49

External Links

Handle

pauliax

Vulnerability details

Impact

When the signature is not valid, ecrecover returns empty (0x0) address. There is a potential check against that: require( (recoveredAddress != address(0) && recoveredAddress == owner) || isApprovedForAll[owner][recoveredAddress], "INVALID_PERMIT_SIGNATURE" ); However, the parentheses are not in place here, as an empty address check does not impact the OR condition. To bypass this check an attacker only needs the owner to have his isApprovedForAll set to 0x0. Then he can maliciously pass an invalid signature and this OR branch will result in 'true' allowing this bad actor to set any address as the new operator: isApprovedForAll[owner][operator] = true;

Recommended solution: require( recoveredAddress != address(0) && (recoveredAddress == owner || isApprovedForAll[owner][recoveredAddress], "INVALID_PERMIT_SIGNATURE" ); Overall, I would like to recommend using a battle-tested ECDSA library for signature verifications: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol

#0 - sarangparikh22

2021-10-13T23:27:45Z

Duplicate of #44

#1 - alcueca

2021-11-12T10:29:30Z

Severity 2 since for the loss of assets the asset owner need to execute an unrelated, but uncommon, operation.

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