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.
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.
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
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.