Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: low
Invalid

Missing Deadline Checks in CurveAdapter Swaps

Summary

CurveAdapter.sol inherits from BaseAdapter which contains a deadline state variable, but fails to utilize this deadline check in its swap functions (executeSwapExactInputSingle and executeSwapExactInput). This omission can lead to transactions being valid for an unlimited time, potentially exposing users to MEV (Miner Extractable Value) attacks and unfavorable trade execution.

Vulnerability Details

In CurveAdapter.sol, both swap functions:

function executeSwapExactInputSingle(SwapExactInputSinglePayload calldata swapPayload)
function executeSwapExactInput(SwapExactInputPayload calldata swapPayload)

do not implement deadline checks despite inheriting the deadline functionality from BaseAdapter.

The BaseAdapter contract includes:

uint256 deadline;

but this value is never checked in the CurveAdapter's swap execution functions.

Other parts of the codebase, such as the StabilityBranch, properly implement deadline checks:

if (deadlineCache > block.timestamp) {
revert Errors.RequestNotExpired(msg.sender, requestId);
}

Impact

  • Transactions can remain pending in the mempool indefinitely

  • Increased exposure to MEV attacks

  • The attacker can't make you lose more than your slippage tolerance, but they can optimize when the trade executes to their advantage.

  • They can force trades to execute at the worst price within those bounds

Tools Used

  • Manual code review

Recommendations

  • Implement deadline checks in both swap functions

Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

CurveAdapter does not enforce swap execution time limits like other adapters do

Appeal created

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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