Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 1.35 KB

Initialization functions can be front-run.md

File metadata and controls

33 lines (27 loc) · 1.35 KB

Hermez, HermezAuctionProtocol, and WithdrawalDelayer have initialization functions that can be front-run, allowing an attacker to incorrectly initialize the contracts. Due to the use of the delegatecall proxy pattern, Hermez, HermezAuctionProtocol, and WithdrawalDelayer cannot be initialized with a constructor, and have initializer functions.

All these functions can be front-run by an attacker, allowing them to initialize the contracts with malicious values.

Recommendation:

Short term, either: 1. Use a factory pattern that will prevent front-running of the initialization, or 2. Ensure the deployment scripts are robust in case of a front-running attack.

Carefully review the Solidity documentation, especially the Warnings section.

Carefully review the pitfalls of using delegatecall proxy pattern.


Slide Screenshot

048.jpg


Slide Text

  • ToB Audit Hermez Finding 12
  • Configuration
  • High Severity
  • Front-running
  • Initialization Functions
  • Factory-pattern
  • Atomic Deploy/Init Script

References


Tags