Holographable Configuration's signature can be bypassed #70
Labels
bug
Something isn't working
grade-c
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2022-10-holograph/blob/main/src/HolographFactory.sol#L118-L121
https://github.com/code-423n4/2022-10-holograph/blob/main/src/HolographFactory.sol#L234-L235
Vulnerability details
Impact
When deploying an holographable smart contract, the
deployHolographableContract()
method requires a signature to verify that the original creator's configuration has not been altered.The signature verification checks the result of
ecrecover()
with an externally providedsigner
address. The result ofecrecover()
and thesigner
address are not checked againstaddress(0)
so the verification can be bypassed by providingaddress(0)
as thesigner
address.Proof of Concept
deployHolographableContract()
withsigner
equal toaddress(0)
deployHolographableContract()
methods call_verifySigner()
to validate the signatureercrecover()
calls returnaddress(0)
as the signatures are invalid but this is equal tosigner
_verifySigner()
function returns true, although the signature is invalidTools Used
Manual review.
Recommended Mitigation Steps
Verify the return value of
ecrecover()
againstaddress(0)
.The text was updated successfully, but these errors were encountered: