Open hats-bug-reporter[bot] opened 5 months ago
@luzzif This issue assumes there are two similar campaigns by the owner running on two different chains. In this case, if the user is able to claim rewards on both chain A and chain B, that means it is intentional for the user to earn rewards on both chains since the root is set by the updater. If the root on chain B is different, the user cannot claim the rewards. I do not think this is an issue since at the end it is the updater setting the roots across chains after seeing who is eligible to earn rewards and who is not.
You're right on this one too actually. If the same root is on multiple chains, assuming the updater does its job correctly, it's only right that the same claim can be processed on both chains without any apparent issue.
Hi @luzzif and @mcgrathcoutinho.
The possibility of the transaction replay still exists and lingers. If a malicious campaign owner uses it to his/her advantage by creating two identical campaigns, then uses his/her own wallet (another wallet) and does the replay transaction himself/herself which is very feasible because he/she will basically replicate his/her rewards.
But this wouldn't make much sense. The attacker would need to create a second campaign, putting rewards on the line, to only get a portion of them back by replaying a transaction/claim?
@luzzif Got it. You're right. I misinterpreted the purpose of the campaign itself. Thanks for explaining.
Github username: -- Twitter username: -- Submission hash (on-chain): 0xe37fb55a31f8d87b0655e71114e2825ce9b102b2694c790becc5002ec8784262 Severity: high
Description: Description\
- SUMMARY -
As stated in the Discord Q&A: "The Metrom contract will be deployed on multiple chains according to demand (if a dex strictly requires the Metrom campaigns to live on chain A, we'll deploy an instance there too)."
However, the existing implementation of merkle tree proofs fails to consider this aspect, thus enabling the replication of transactions across chains.
- DETAILS -
Within the
claimRewards()
function, the_processRewardClaim()
function is called invokingMerkleProof.verifyCalldata()
as shown in the code below.claimRewards()
_processRewardClaim()
In
_processRewardClaim()
function, the lineif (!MerkleProof.verifyCalldata(_bundle.proof, campaign.root, _leaf)) revert InvalidProof()
can be bypassed on different chains by exploiting the deterministic nature of smart contracts (and EVM in general). If an attacker creates a successful transaction in Ethereum Mainnet, he/she can copy this and execute it on another EVM compatible chain.Attack Scenario\
claimRewards()
and satisfying all the arguments required in the_bundles
parameter.proof
androot
, have already been revealed.claimRewards()
function with identical arguments used in the successful transaction during Step 1.- IMPACT -
Given that rewards can be replicated for each attacker across multiple chains, the protocol faces the risk of losing funds.
Attachments
Proof of Concept (PoC) File n/a
Revised Code File (Optional) n/a