DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: medium
Invalid

Filling of offChainOrders by keepers can fail if offchain orders are spammed by user or group of users

Summary

If too many offchain orders are created by users, keeper can be DOSsed and run out of gas when attempting to fill them. This can be done intentionally with malicious intent or happen during normal operation.

Vulnerability Details

The system provides a means for users to sign offchain orders which are broadcasted to the network and the keeper is called to fill these orders.

/// @notice Fills pending, eligible offchain offchain orders targeting the given market id.
/// @dev If a trading account id owner transfers their account to another address, all offchain orders will be
/// considered cancelled.
/// @param marketId The perp market id.
/// @param offchainOrders The array of signed custom orders.
/// @param priceData The price data of custom orders.
function fillOffchainOrders(
uint128 marketId,
OffchainOrder.Data[] calldata offchainOrders,
bytes calldata priceData
)
external
onlyOffchainOrdersKeeper(marketId)
{
......................................................... }

According to the function NatSpec,the keeper fills pending offchain orders for a given market. Therefore we can assume the keeper would attempt to fill all active offchain orders. An attacker can sign dozens or hundreds of offchain orders with negligible position changes, causing the keeper to attempt to fill them all. Here, either the keeper runs out of gas when attempting to fill these orders or other users legitimate offchain orders would be delayed significantly. Either way legitimate users can be griefed.

Impact

Filling of offchain orders by the keepers can be caused to fail, causing grief to users and protocol.

Tools Used

Manual Review

Recommendations

No clear mitigation at this moment

Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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