Skip to content
DoS Audit finding Intermediate

In OracleLess.createOrder() feeBips value validation is missing

The createOrder function in OracleLess.sol lacks validation that feeBips is at most 10000, allowing orders with excessive fees that always revert in execute. A malicious user can create many such orders, and by using a blacklisted token like USDC, prevent cancellation, causing a denial of service as the pending orders queue grows.

phoenixv110 Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-11-oku-judging/issues/277

Found by

phoenixv110

Summary

The max value of feeBips should be <=10000. But this validation is missing in createOrder(). All such orders where feeBips is > 10000 will revert in execute() method. A malicious user can create 100s of such orders which never execute even if the price conditions are met. It can use USDC as tokenIn and blacklist itself so that _cancelOrder() also reverts. As _cancelOrder() tries to transfer tokenIn to the user. If the receiver is blacklisted user then transfer will fail. This was the malicious user can create 1 wei orders will can neither execute nor cancellable.

https://github.com/sherlock-audit/2024-11-oku/blob/main/oku-custom-order-types/contracts/automatedTrigger/OracleLess.sol#L38C5-L67C6

Root Cause

Missing feeBips input validation in createOrder()

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

Such orders will exist in the pendingOrderIds which can not be deleted from the queue. These orders can increase the queue size until the max gas usage limit is reached. Which will DoS all other orders.

PoC

No response

Mitigation

Add the check feeBips <= 10000 in createOrder() of OracelLess.sol.

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/gfx-labs/oku-custom-order-types/pull/1

The original report as published on Sherlock, by phoenixv110. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Missing validation that feeBips is less than or equal to 10000 in createOrder().

Impact

Orders with invalid feeBips cannot be executed or cancelled, and they accumulate in the pending queue, potentially causing a denial of service by exhausting gas limits.

What the attacker needed

Attacker can create orders; attacker uses a blacklistable token like USDC; attacker is blacklisted by the token

The fix

The protocol team fixed this issue by adding a check that feeBips <= 10000 in createOrder().

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract lets users create orders with a fee percentage. The code forgot to check that this percentage isn't over 100%, so someone can set it to a huge number. When the system tries to execute such an order, it fails, and if the user also makes cancellation fail (by using a token that blocks them), the order gets stuck forever, clogging the system.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More from Oku's New Order Types Contract Contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.