Vulnerable contract can be deployed if developer forgets to properly configure admin while extending ERC721H/ERC20H #174
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/main/contracts/abstract/ERC721H.sol#L140-L154
Vulnerability details
Impact
Source contract can be uninitialized with
owner
value that will lead to vulnerable contract that is not able to call functions withonlyOwner
modifier.Proof of Concept
To create source contract you need to extend
ERC721H/ERC20H
abstract contract. It hasonlyOwner
modifier. This modifier is needed to restrict some functions to the owner of source contract as you can see for example here.Function
ERC721H.init
is responsible for initializing of source contract. Source contract can also override it. The problem is thatERC721H.init
doesn't setowner
for the contract.Because of this, it's possible that source contract will not provide
owner
and will not work properly.Tools Used
Recommended Mitigation Steps
Consider adding hook for extender to provide owner and then check that they did it.
The text was updated successfully, but these errors were encountered: