Lack of zero address check for ecrecover allows to bypass the signature verification #390
Labels
bug
Something isn't working
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
Lines of code
https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographFactory.sol#L192-L264
Vulnerability details
Lack of zero address check for ecrecover allows to bypass the signature verification
DeploymentConfig
,signature
,signer
. However, it's possible to bypass the require statement which verifies the signer by passingaddress(0)
as a signer arg and some invalid signature withv
being not equal to 27 or 28. As a resultecrecover()
will returnaddress(0)
for invalid signature.Proof of Concept:
The current tx: 0xcb1e58f6db0321b61869ea38f03d246c3809725b00be201cc0299fcd9a1dd57f on Goerli test network will disclose the scenario above.
Also, I've simulated exact transaction using tenderly in order to debug and see state changes much closer. Click to see
I'll attach a simple test case that helps to cover discovered scenario.
After having a disscussion with
@acc01ade
(dev team), i figured out that the following exploit might have major impact on Holograph protocol.Mitigation Steps:
address(0)
.The text was updated successfully, but these errors were encountered: