No zero value return check in ecrecover in signature verification in HolographFactory contract #357
Labels
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
duplicate
This issue or pull request already exists
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
responded
The Holograph team has reviewed and responded
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographFactory.sol#L320-L335
https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographFactory.sol#L220
Vulnerability details
Impact
The _verifySigner() function in HolographFactory contract makes a ecrecover() call without checking for address(0) result. Due to user controlled signer input, it is possible for anyone to call the deployHolographableContract() function with address(0) as signer, and crafting signature input such that ecrecover() would return address(0) , then this will return true in _verifySigner() allowing the user to deploy contracts.
Proof of Concept
The code snippet above is missing a check to ensure the ecrecover() result != address(0).
With above bug, Alice can;
Tools Used
Manual review
Recommended Mitigation Steps
Add a check to ensure that ecrecover returned result is not equals to address(0)
The text was updated successfully, but these errors were encountered: