DittoETH

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

Front Running on Order Creation

Summary

createAsk does not check that msg.sender matches the maker parameter. This allows an attacker to insert their own transaction before a legitimate one..

Vulnerability Details

There is no validation that maker == msg.sender in the create functions. An attacker could watch for transactions and insert their own before the legitimate one executes.

For example in createAsk():

function createAsk(
address maker,
// ...
) external {
// No check of maker == msg.sender
Ask storage a = askOrders.insert(
keccak256(abi.encodePacked(collateralAmount, //...));
// Front run possible
}

Impact

Attacker could drain funds by filling their own orders before the user.

Tools Used

Manual

Recommendations

Add onlyMaker modifier to create functions:

modifier onlyMaker(address maker) {
require(maker == msg.sender, "Not maker");
_;
}
function createAsk(
address maker,
// ...
) external onlyMaker(maker) {
// ...
}
Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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