code-423n4 / 2021-12-yetifinance-findings

0 stars 0 forks source link

`setAddresses` functions can be frontrun #195

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

cmichel

Vulnerability details

The setAddresses function that initializes important contract state can be called by anyone.

See:

Impact

The attacker can initialize the contract before the legitimate deployer, hoping that the victim continues to use the same contract. In the best case for the victim, they notice it and have to redeploy their contract costing gas.

Recommended Mitigation Steps

Use the constructor to initialize the addresses.

kingyetifinance commented 2 years ago

Duplicate #105