stellar / soroban-examples

Example Soroban Contracts
Apache License 2.0
57 stars 60 forks source link

Prevent contracts from being re-initialized #307

Closed matiassequeira closed 4 months ago

matiassequeira commented 4 months ago

What Prevent the init function front being executed after the contract has already been initialized.

Why Incorporating a security feature to prevent adversaries from substituting the admin by invoking the init function, enabling them to upgrade the contract to a malicious version. This fix prevents anyone copying the upgrade functionality from replicating this vulnerability in their contracts.

Known limitations N/A

matiassequeira commented 4 months ago

Hi @dmkozh, all the checks pass now. It requires your approval again, thanks.