Holograph contest - arcoun's results

Omnichain protocol for deploying, minting, & bridging NFTs between blockchains.

General Information

Platform: Code4rena

Start Date: 18/10/2022

Pot Size: $75,000 USDC

Total HM: 27

Participants: 144

Period: 7 days

Judge: gzeon

Total Solo HM: 13

Id: 170

League: ETH

Holograph

Findings Distribution

Researcher Performance

Rank: 97/144

Findings: 2

Award: $6.83

QA:
grade-c

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: minhtrng

Also found by: Chom, Jeiwan, Lambda, arcoun, cccz, csanuragjain, ctf_sec

Labels

bug
duplicate
2 (Med Risk)

Awards

6.8336 USDC - $6.83

External Links

Lines of code

https://github.com/code-423n4/2022-10-holograph/blob/main/src/HolographOperator.sol#L283 https://github.com/code-423n4/2022-10-holograph/blob/main/src/HolographOperator.sol#L804

Vulnerability details

Impact

If the selected operator fails to complete a job by calling executeJob(), it can be slashed by an other user. When the allowed duration has expired, 5 fallback operators can execute the job while timeDifference < 6. After that delay, any user can execute it and be rewarded with utility tokens.

In that case, any user can execute an expired job to slash the selected operator, not only registered operators. But if the user is not a registered operator, he will be unable to retrieve his gains from the contract, they will be frozen. He will be unable to get them through unbondUtilityToken() as _bondedOperators[operator] will be equal to 0 and he will not be able to register as an operator because _bondedAmounts[operator] will be greater than 0.

Proof of Concept

  • A job is created through crossChainMessage() and an operator is selected to execute it
  • The selected operator fails to call executeJob() during the allowed delay
  • None of the fallback operators call executeJob() during the fallback delay
  • A user, who has never registered as an operator, call executeJob() to execute it
  • The selected operator is slashed and _getBaseBondAmount(pod) utility tokens are internaly transfered to the user (L276-L283)
  • The user is unable to call unbondUtilityToken() due to the _bondedOperators[operator] != 0 requirement (L804)
  • The user is unable to registered as an operator due to the _bondedAmounts[operator] == 0 requirement (L758)
  • The gains are frozen in the contract and can't be retrieved

Tools Used

Manual review.

Allow the user to retrieve his gains or prevent him to gain them.

#0 - gzeoneth

2022-10-30T16:29:13Z

Duplicate of #322

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.

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

#0 - gzeoneth

2022-10-30T15:27:20Z

Duplicate of #357

#1 - gzeoneth

2022-11-21T07:16:36Z

As QA report

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter