Initializer Function Exploits
Initializer function exploits occur when a contract's initialization logic is left unprotected, allowing an attacker to claim ownership or set critical parameters. Unlike traditional constructors that run once during deployment, proxy contracts require a separate initializer function because the proxy itself does not have a constructor that executes in the context of the implementation.
If this function is not restricted to a single execution or proper access control, any user can call it to initialize the contract. This can lead to the attacker setting themselves as the administrator or modifying protocol parameters to their advantage.
To secure this, developers use modifiers that ensure the initializer is called exactly once. This is a standard requirement for all upgradeable contracts to prevent post-deployment hijacking.