DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: medium
Invalid

Front-Running Vulnerabilities in DittoEth's Orderbook

Summary

The orderbook mechanism implemented in the DittoEth protocol's OrdersFacet.sol smart contract presents potential front-running risks. Specifically, the cancelBid(), cancelAsk() and cancelShort() functions may be susceptible to front-running, putting traders at risk of unfair execution of their trades.

Vulnerability Details

Order books on-chain have been criticized for their slow processing speeds, which can be exploited by malicious actors, particularly miners. In the DittoEth protocol, the observed vulnerabilities lie in the cancelBid(), cancelAsk() and cancelShort() functions. Malicious actors or miners can prioritize transaction acceptance of a bid over its cancellation, thereby preventing a user from cancelling a bid when market conditions change unfavorably. This can be exploited by accepting a bid before its associated cancellation transaction gets processed, even if the cancellation was initiated first by the trader.

Impact

Potential loss of funds for traders. If they are unable to cancel their orders in time due to mempool manipulations, they may be forced into unfavorable trades. Furthermore, this vulnerability can undermine the trust in the DittoEth protocol, making users hesitant to engage in trades using the platform. Such front-running attacks can distort the fairness of the trading environment and can lead to significant financial implications for affected users.

Recommendations

Implement Commit-Reveal Scheme: Implement a commit-reveal scheme. Users first commit to an action without revealing specifics. After all commitments are made, users reveal their intended actions, which are then processed.

Batch Processing: Process orders in batches rather than in real-time. This minimizes the opportunity window for front-running.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other
happyformerlawyer Auditor
over 1 year ago
0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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