Skip to content
Business logic Audit finding Intermediate

RubiconRouter: Offers created through offerForETH cannot be cancelled

Offers created via RubiconRouter's offerForETH set the router as the offer owner, but the router lacks a cancellation function. If no one accepts the offer, the user's tokens remain locked in the contract.

cccz Follow

Originally disclosed on Code4rena

Submitted by cccz

When a user creates an offer through the offerForETH function of the RubiconRouter contract, the offer function of the RubiconMarket contract is called, and the RubiconRouter contract address is set to offer.owner in the offer function.

But the RubiconRouter contract does not implement a function to cancel this offer. This means that if no one accepts the offer, the user’s tokens will be locked in the contract.

Proof of Concept

https://github.com/code-423n4/2022-05-rubicon/blob/8c312a63a91193c6a192a9aab44ff980fbfd7741/contracts/RubiconRouter.sol#L412-L437

Recommended Mitigation Steps

Implement cancelForERC function to cancel this offer. And set the owner of offer_id to msg.sender in offerForETH function and check it in cancelForERC function

bghughes (Rubicon) marked as duplicate:

Duplicate of #17.

HickupHH3 (judge) commented:

Not a duplicate. Referring to separate lacking functionality of cancellation of ERC20 -> WETH offers (eg. a cancelWithETH function).


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

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

The router contract sets itself as the offer owner but does not provide a function to cancel offers it created.

Impact

Users' tokens could be locked in the contract if no one accepts their offer.

What the attacker needed

User creates offer via offerForETH; no one accepts the offer

The fix

Implement a cancelForERC function and set the offer owner to msg.sender in offerForETH, checking it in cancelForERC.

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.

When you use a smart contract to make a trade offer, the contract becomes the owner of that offer. If the contract has no way to cancel the offer, your tokens stay stuck until someone accepts. This report points out that missing cancel function.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by cccz

View all

104 more disclosed reports, best first.

More from Rubicon v2

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.