The fillOrder and modifyOrder functions in OracleLess.sol lack a nonReentrant modifier, allowing an attacker to reenter modifyOrder during fillOrder's external call and manipulate order amounts to steal funds. An attacker could steal victim and protocol funds at no substantial cost.
The PythOracle contract's freshness check uses a reversed comparison, so it always treats price data as stale. As a result, valid orders that rely on this oracle fail to execute.
The order creation function does not check whether the recipient address is blacklisted by the token, so an attacker can create cheap orders with a blacklisted recipient. These orders cannot be cancelled because the cancellation function tries to refund the blacklisted address, allowing the attacker to fill the pending orders array and cause a denial of service.
A cancelled order could still be modified, allowing a user to withdraw the same tokens twice. An attacker could repeatedly cancel and modify orders to drain all tokens from the contracts.
The order ID generation in Oku's contracts uses only block number and user address, so two different contracts (Bracket and StopLimit) can produce the same order ID in the same block. An attacker could create orders in both contracts with the same ID and then cancel the order twice to receive duplicate refunds.
The contract approves a target address to spend the order's input tokens but never resets that approval to zero after the call. A malicious target can leave most of the allowance unspent and later use it to drain the contract's token balance.
Multiple contracts in the protocol perform unsafe downcasting from uint256 to uint160 when handling token amounts in Permit2 transfers, allowing users to create orders with mismatched amounts. An attacker could create an order with a high amount but pay very little, then modify or cancel the order to drain the contract.
The OracleLess contract does not verify that tokenIn is a legitimate ERC20 token and does not validate the target and txData in fillOrder, allowing an attacker to create an order with a malicious token and execute it with a malicious target to drain all USDT from the contract.
The StopLimit contract grants the Bracket contract an unlimited allowance to spend its input tokens. An attacker can create a Bracket order and call performUpkeep with crafted data to make Bracket transfer all of StopLimit's tokens to itself, then receive them as order output.
The Bracket and StopLimit contracts allow users to create orders with the recipient set to the zero address. When the admin tries to cancel such an order, the token transfer to the zero address reverts for tokens like USDT, making the order uncancellable and allowing an attacker to fill the pending order array and cause a denial of service.
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.
The protocol's order creation and modification functions use the order recipient as the owner for token transfers, allowing an attacker to create an order that pulls tokens from a victim who has a residual allowance. The attacker can then fill the order and profit while the victim loses tokens.
The createOrder function allowed orders with zero input amount, letting an attacker create many such orders. This bloated the pendingOrderIds array, causing fillOrder and cancelOrder to run out of gas when iterating it, blocking all users from filling or cancelling orders.
The OracleLess contract allows any token address as tokenIn, so an attacker can create orders with a malicious token that reverts on transfer, making the order impossible to cancel. An attacker could create many such orders to grief the protocol and waste gas for other users.
The smart contract allows users to create orders without paying a fee, and the number of pending orders is capped. An attacker can fill all available order slots with orders that can never be executed, and when the admin cancels them, the attacker can immediately recreate them, causing a denial of service for legitimate users.
A StopLimit order that passed the minimum order size check at creation can fail to fill later if the token's price drops, because the resulting Bracket order re-checks the minimum size and reverts. This prevents the StopLimit order from being executed.
The `_cancelOrder` function loops through an unbounded `pendingOrderIds` array, so an attacker can create many orders with a malicious token that reverts on transfer, making cancellation impossible for legitimate users and the admin. This creates a denial-of-service condition and potential financial ransom.
An order's direction is set at creation based on the current exchange rate relative to the take-profit price. If the price moves past the take-profit before execution, the order may be treated as a stop order, applying the stop slippage instead of the take-profit slippage, which could cause higher losses if stop slippage is larger.
OS
Oku's New Order Types Contract Contest
Medium
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.