Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 1.97 KB

Missing validation of `owner` argument could indefinitely lock owner role.md

File metadata and controls

43 lines (34 loc) · 1.97 KB

A lack of input validation of the _owner argument in both the constructor and setOwner functions could permanently lock the owner role, requiring a costly redeploy.

To resolve an incorrect owner issue, Uniswap would need to redeploy the factory contract and re-add pairs and liquidity.

Users might not be happy to learn of these actions, which could lead to reputational damage.

Certain users could also decide to continue using the original factory and pair contracts, in which owner functions cannot be called.

This could lead to the concurrent use of two versions of Uniswap, one with the original factory contract and no valid owner and another in which the owner was set correctly.

Trail of Bits identified four distinct cases in which an incorrect owner is set:

  1. Passing address(0) to the constructor
  2. Passing address(0) to the setOwner function
  3. Passing an incorrect address to the constructor
  4. Passing an incorrect address to the setOwner function.

Recommendation:

Several improvements could prevent the four above mentioned cases: 1. Designate msg.sender as the initial owner, and transfer ownership to the chosen owner after deployment. 2. Implement a two-step ownership-change process through which the new owner needs to accept ownership. 3. If it needs to be possible to set the owner to address(0), implement a renounceOwnership function.


Slide Screenshot

049.jpg


Slide Text

  • ToB Audit Uniswap V3 Finding 1
  • Data Validation
  • Medium Severity
  • Incorrect owner
  • Redeploy Contract
  • Owner = msg.sender
  • Two-step Change

References


Tags