Frontrunning of some initializers to grief deployment possible #201
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
invalid
This doesn't seem right
responded
The Holograph team has reviewed and responded
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Lines of code
https://github.com/code-423n4/2022-10-holograph/blob/24bc4d8dfeb6e4328d2c6291d20553b1d3eff00b/src/HolographBridge.sol#L63
https://github.com/code-423n4/2022-10-holograph/blob/24bc4d8dfeb6e4328d2c6291d20553b1d3eff00b/src/HolographFactory.sol#L44
https://github.com/code-423n4/2022-10-holograph/blob/24bc4d8dfeb6e4328d2c6291d20553b1d3eff00b/src/HolographOperator.sol#L141
Vulnerability details
Impact
The initializer function (
init
) is callable by anyone, not only the deployer of the contracts. For some contracts that are deployed by a factory (e.g.,Holographer
), this is not problematic because the factory will immediately initialize after deployment (in the same transaction), meaning no frontrunning is possible. However, some contracts (like the factory itself) are not deployed with a smart contract. For these, someone can frontrun theinit
call. In the worst case, when this is not detected, a deployment with wrong parameters (e.g., a different admin) is used. But even if it is detected, an attacker could continously front-run the call to make all deployments unusable.Proof Of Concept
The
HolographFactory
contract is deployed and an attacker frontruns theinit
call. Because this deployment becomes useless, it is deployed again and the call is frontrun again, and again, and again...Recommended Mitigation Steps
Store the deployer (temporarily), only let this address initiate the contracts.
The text was updated successfully, but these errors were encountered: