Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean Hemp Barracuda - Front-Runnable maxFee Reduction #56

Open
sherlock-admin2 opened this issue Jan 31, 2025 · 0 comments
Open

Clean Hemp Barracuda - Front-Runnable maxFee Reduction #56

sherlock-admin2 opened this issue Jan 31, 2025 · 0 comments
Labels
Sponsor Disputed The sponsor disputed this issue's validity

Comments

@sherlock-admin2
Copy link
Contributor

Clean Hemp Barracuda

Medium

Front-Runnable maxFee Reduction

Summary

Users can reduce the maxFee of an existing order, creating a race condition where keepers may execute orders at lower fees than initially promised.

point is the placeOrder function. It allows updating an order with a lower maxFee, which might let users reduce fees after keepers have already committed gas. This creates a race
condition where keepers might not get paid adequately, leading to potential
losses.

Root Cause

Code Reference:

function _placeOrder(...) private {
    if (!old.isEmpty() && old.maxFee.gt(order.maxFee)) 
        revert ManagerCannotReduceMaxFee(); // ❌ Only prevents reducing maxFee, not front-running
}

Internal Pre-conditions

No response

External Pre-conditions

No response

Attack Path

Scenario:

  1. User Action: Alice places an order with maxFee = 10 DSU.
  2. Keeper Sees Order: Begins processing, expecting 10 DSU.
  3. User Front-Runs: Updates order to maxFee = 5 DSU.
  4. Result: Keeper receives 5 DSU but spent gas based on 10 DSU.

Impact

  • Keeper Losses: Keepers commit gas expecting a higher fee, but receive less after a user front-runs the transaction.
  • Protocol Trust: Users can exploit this to underpay keepers, damaging protocol credibility.

PoC

No response

Mitigation

  • Enforce a minimum fee increase threshold (e.g., newMaxFee ≥ oldMaxFee * 0.9).
  • Implement a time-delay for fee reductions.
@sherlock-admin3 sherlock-admin3 added the Sponsor Disputed The sponsor disputed this issue's validity label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sponsor Disputed The sponsor disputed this issue's validity
Projects
None yet
Development

No branches or pull requests

2 participants