Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Holographable Configuration's signature can be bypassed #70

Closed
code423n4 opened this issue Oct 21, 2022 · 2 comments
Closed

Holographable Configuration's signature can be bypassed #70

code423n4 opened this issue Oct 21, 2022 · 2 comments
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

Comments

@code423n4
Copy link
Contributor

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 provided signer address. The result of ecrecover() and the signer address are not checked against address(0) so the verification can be bypassed by providing address(0) as the signer address.

Proof of Concept

  • An invalid signature is provided to deployHolographableContract() with signer equal to address(0)
  • The deployHolographableContract() methods call _verifySigner() to validate the signature
  • Both ercrecover() calls return address(0) as the signatures are invalid but this is equal to signer
  • The _verifySigner() function returns true, although the signature is invalid
  • Signature verification has been bypassed

Tools Used

Manual review.

Recommended Mitigation Steps

Verify the return value of ecrecover() against address(0).

@code423n4 code423n4 added 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 labels Oct 21, 2022
code423n4 added a commit that referenced this issue Oct 21, 2022
@gzeoneth
Copy link
Member

Duplicate of #357

@gzeoneth gzeoneth marked this as a duplicate of #357 Oct 30, 2022
@gzeoneth gzeoneth added the duplicate This issue or pull request already exists label Oct 30, 2022
@gzeoneth gzeoneth added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Nov 21, 2022
@gzeoneth
Copy link
Member

As QA report

@gzeoneth gzeoneth reopened this Nov 21, 2022
@gzeoneth gzeoneth removed the duplicate This issue or pull request already exists label Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants