The clone-with-immutable-args pattern is unsafe to use when one of the immutable arguments controls an address being delegated to.
an attacker is able to forge the calldata that the proxy normally would forward, and can cause the implementation to selfdestruct()
itself via a delegatecall()
. The current code has a vulnerability, where every account performs a delegatecall()
to an address coming from the factory, which is a forgeable immutable argument.
In createAccount the AccountImplementation
args is a immutable arg , and it passes the initData passed as a arg in the fuunction without proper sanitation, which after creating the account passes the initData
and, This is where the initData is decoded and delegate calls to the address after decoding
The main issue is, privileges defined in the reference implementation have control over that instance, and could eventually force a destruction of the contract using a fallback handler with a selfdestruct
instruction
Manual Review
Use a state/contract variable for anything requiring being delegated to.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.