Phoenix-Protocol-Group / phoenix-contracts

Source code of the smart contracts of the Phoenix DeFi hub DEX protocol
GNU General Public License v3.0
10 stars 6 forks source link

PHOAM-006: Anyone can re-initialize trader contract to steal balance #328

Closed gangov closed 2 weeks ago

gangov commented 2 weeks ago

Description Anyone can re-initialize the trader contract to gain administrator privileges and steal the contract balance. The initialize function does not restrict how many times it can be called. Additionally, it does not verify that the admin address passed as a parameter matches the existing contract administrator address, if it was set.

Recommendation Make sure the initialize function can only be called once, similarly to what the pool contracts do.