Sablier

Sablier
DeFiFoundry
53,440 USDC
View results
Submission Details
Severity: medium
Valid

Use of `create` method which are vulnerable to reorgs

Summary

MerkleLL and MerkleLT creation is done through CREATE opcode which is vulnerable to reorgs, especially as the protocol aims to deploy on various EVM chains.

Vulnerability Details

The protocol aims to deploy on EVM compatible chains, including optimistic rollups (Optimism/Arbitrum) are notorious of having reorgs issues. Other chains like ethereum, polygon etc also have reorgs happen at one point in the past or another.
The creation of the Merkles LL and LT relies on ordinary CREATE opcode which is vulnerable to these kinds of attacks. The issue would happen when users rely on the address derivation in advance or try to deploy the position clone with the same address on different EVM chains and try to fund the merkles, the sent funds to the new contract could potentially be withdrawn by another user which could lead to the theft of user funds.

function createMerkleLL(
...
// Deploy the MerkleLockup contract with CREATE.
merkleLL = new SablierV2MerkleLL(baseParams, lockupLinear, streamDurations);
...
}
function createMerkleLT(
...
// Deploy the MerkleLockup contract with CREATE.
merkleLT = new SablierV2MerkleLT(baseParams, lockupTranched, tranchesWithPercentages);
...
}

A user deploys a new Merkle, and then sends funds to it. Another user sees that the network block reorg happens and calls create function. Thus, it creates the merkle with an address to which first user initially sent funds. Then the first user's transaction gets executed and the transferred funds are sent to the second user's controlled merkle.

Impact

If users rely on the address derivation in advance, any funds/tokens sent to it could potentially be withdrawn by anyone else leading to the theft of user funds.

Tools Used

Manual Review

Recommendations

Try the deployment using create2 with salt that includes real msg.sender.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

CREATE is vulnerable to ChainReorgs

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.