Holograph contest - teawaterwire'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: 98/144

Findings: 2

Award: $1.97

QA:
grade-c

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: minhtrng

Also found by: Deivitto, V_B, __141345__, adriro, cdahlheimer, d3e4, ladboy233, nadin, teawaterwire

Labels

bug
duplicate
2 (Med Risk)

Awards

1.9681 USDC - $1.97

External Links

Lines of code

https://github.com/code-423n4/2022-10-holograph/blob/f8c2eae866280a1acfdc8a8352401ed031be1373/contracts/HolographOperator.sol#L499

Vulnerability details

Impact

Because of the pseudo-randomness of the random variable

uint256 random = uint256(keccak256(abi.encodePacked(jobHash, _jobNonce(), block.number, block.timestamp)));

an operator could front-run calls to crossChainMessage() to join the right pod at the right index to be selected immediately for a job

Proof of Concept

using a custom contract, an attacker can pass jobHash and the nonce to a function that will then be able to compute the random variable (by copying the exact line of code above)

then inside that same function, they can call the external function getTotalPods thus deducing which pod will be selected

by calling the other external function getPodOperatorsLength they can deduce the index that would be selected should they join that pod

if the index ends up being 0 or the last one, they it means they can join that pod

if not the transaction can revert allowing to submit at no cost through Flashbots.

maybe adding a cooling period before an operator can unbondUtilityToken

#0 - gzeoneth

2022-10-30T17:14:51Z

Duplicate of #27

Anyone can call bondUtilityToken for an operator, there is no check on msg.sender

not a critical finding, but could be used as grieving attack to prevent an operator to bond to a particular pod by front-running them and bonding them to another pod (though the operator could still withdraw from that pod and join another one)

maybe a check on msg.sender == operator to be safe

#0 - alexanderattar

2022-11-09T21:56:16Z

Anyone should be able to bond. There is no way to check if someone is running the operator CLI from the chain

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