ThunderLoan is deployed behind an ERC1967Proxy constructed with empty init data, so initialize runs in a separate transaction after deployment. initialize is protected only by the initializer modifier — anyone may call it first.
An attacker who front-runs the deployer's initialize becomes owner. The owner authorizes upgrades (_authorizeUpgrade is onlyOwner), so a hijacked initialization is a full takeover: upgrade to a malicious implementation and drain every AssetToken.
Likelihood: Medium
There is a public window between proxy deployment and initialization; front-running that tx is routine mempool activity.
Impact: High
Attacker becomes owner and can upgrade the implementation to drain all deposits.
The test reproduces the exact deployment shape (an ERC1967Proxy built with empty _data), then has attacker call initialize before the deployer does. attacker ends up as owner, which is sufficient to authorize a malicious upgrade:
Initialize atomically: pass the initialize calldata as the proxy's _data in the ERC1967Proxy constructor so deployment and initialization happen in one transaction and cannot be front-run.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.