Two inits for the same contract #220
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
invalid
This doesn't seem right
primary issue
Highest quality submission among a set of duplicates
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/f8c2eae866280a1acfdc8a8352401ed031be1373/contracts/enforcer/PA1D.sol#L173-L198
https://github.com/code-423n4/2022-10-holograph/blob/f8c2eae866280a1acfdc8a8352401ed031be1373/contracts/enforcer/HolographERC721.sol#L259-L261
Vulnerability details
Impact
The PA1D contract have two function to initialize. The
init
and theinitPA1D
functionsThe
init
sets_adminSlot
,_ownerSlot
and callsetRoyalties
butinitPA1D
function only callsetRoyalties
and don't initialize the_ownerSlot
As
setRoyalties
haveonlyOwner
modifier when theHolographERC721
call theinitPA1D
initialize revertsAlso the
setRoyalties
could be used by the owner without initialized restrictionProof of Concept
init
of HolographERC721 callinitPA1D
:initPA1D
of PA1D callsetRoyalties
:setRoyalties
of PA1D haveonlyOwner
modifier:Tools Used
Review
Recommended Mitigation Steps
Remove the
initPA1D
function and use only theinit
functionThe text was updated successfully, but these errors were encountered: