Holograph contest - cryptphi'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: 25/144

Findings: 2

Award: $351.52

QA:
grade-c

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: 0xA5DF

Also found by: Jeiwan, Picodes, cryptphi

Labels

bug
duplicate
3 (High Risk)

Awards

351.522 USDC - $351.52

External Links

Lines of code

https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographBridge.sol#L274-L282 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographOperator.sol#L593 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/module/LayerZeroModule.sol#L293

Vulnerability details

Impact

When a user creates a beam request for a destination chain, the user can input zero as a value for gasLimit. With this, the user is able to make the request without paying any fees to Hologram since messagingModule.getHlgFee(toChain, gasLimit, gasPrice); would return 0 in https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographOperator.sol#L593

Proof of Concept

  1. Alice calls HolographBridge.bridgeOutRequest() to send a beam request with gasLimit as 0.
  2. The call moves on to HolographOperator.send() where the hlgFee returns 0 in the call to getHlgFee() in the messagingmodule contract https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/module/LayerZeroModule.sol#L293
  3. A call to send function in the messaging module with full amount from msg.value without any deductible fees.
  4. No hlgfee is transfered to the hToken contract.

Tools Used

Manual review

Add a zero value check.

#0 - gzeoneth

2022-10-31T13:20:57Z

Duplicate of #294

Lines of code

https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographOperator.sol#L596 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L396

Vulnerability details

Impact

The use of the deprecated transfer() function for an address will inevitably make the transaction fail when the caller is a smart contract and:

1. Does not implement a payable function. 2. Implements a payable fallback which uses more than 2300 gas unit. 3. Implements a payable fallback function that needs less than 2300 gas units but is called through proxy, raising the call's gas usage above 2300.

Additionally, using higher than 2300 gas might be mandatory for some multisig wallets.

Proof of Concept

https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/HolographOperator.sol#L596 https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L396

Tools Used

Manual review

using call() instead of transfer() is recommended as suggested in https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/

#0 - gzeoneth

2022-10-28T09:23:29Z

Duplicate of #33

#1 - gzeoneth

2022-11-21T07:20:50Z

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