QuickSwap and StellaSwap contest - reassor's results

A concentrated liquidity DEX with dynamic fees.

General Information

Platform: Code4rena

Start Date: 26/09/2022

Pot Size: $50,000 USDC

Total HM: 13

Participants: 113

Period: 5 days

Judge: 0xean

Total Solo HM: 6

Id: 166

League: ETH

QuickSwap and StellaSwap

Findings Distribution

Researcher Performance

Rank: 64/113

Findings: 1

Award: $52.21

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-09-quickswap/blob/15ea643c85ed936a92d2676a7aabf739b210af39/src/core/contracts/AlgebraFactory.sol#L77-L81

Vulnerability details

Impact

Function AlgebraFactory.setOwner allows changing ownership by passing new address of the owner. The issue is that changing critical addresses such as ownership should be a two-step process where the first transaction (from the old/current address) registers the new address (i.e. grants ownership) and the second transaction (from the new address) replaces the old address with the new one.

Scenario:

  1. Owner sets new owner via setOwner function.
  2. The new owner address was incorrect and administrative control over protocol is lost.

Proof of Concept

AlgebraFactory.sol:

Tools Used

Manual Review / VSCode

It is recommended to implement two-step process for changing owner address. In addition there should be check if _owner is not a zero-address.

#0 - sameepsi

2022-10-04T06:36:55Z

duplicate of #131

#1 - 0xean

2022-10-04T15:33:20Z

downgrading to QA

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