snapshot-labs / sx-starknet

Core smart contracts of Snapshot X for Starknet
https://docs.snapshotx.xyz
MIT License
118 stars 71 forks source link

audit: M-01 Space Deployment Vulnerable To Front- Running #557

Closed Orland0x closed 1 year ago

Orland0x commented 1 year ago

The deploy function of the factory is meant to deploy new spaces. However, it can be front- run with the same class hash and salt but different initialization calldata. As a result, the attacker may set themselves as the owner of the victim's newly deployed space. The victim may miss or ignore the error messages, think that the space was deployed correctly and then proceed to use it. Consider adding the caller address to the salt in order to bind the contract address to the deployer.