Skip to content
Access control Audit finding Intermediate

RubiconRouter: Offers created through offerWithETH() can be cancelled by anyone

Offers created through the router's offerWithETH function were recorded with the router contract itself as the offer owner rather than the user. As a result, any caller could invoke the router's cancelForETH function to cancel such an offer and receive the ether.

cccz Follow

Originally disclosed on Code4rena

Submitted by cccz, also found by kenzo, 0x1f8b, IllIllI, and pedroais

When a user creates an offer through the offerWithETH 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.

This means that anyone can call the cancelForETH function of the RubiconRouter contract to cancel the offer and get the ether.

Proof of Concept

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

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

Recommended Mitigation Steps

Set the owner of offer_id to msg.sender in offerWithETH function and check it in cancelForETH function.

bghughes (Rubicon) confirmed


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

Likely the offerWithETH function set the router contract as the offer owner instead of the calling user, and cancelForETH did not verify the caller was the original user.

What the attacker needed

Victim creates an offer via offerWithETH; attacker can call cancelForETH

The fix

The owner of the offer should be set to the calling user in offerWithETH and that ownership should be checked in cancelForETH; the project confirmed the finding.

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 is a program on a blockchain that holds funds and runs automatically. Here, when someone placed an order through a helper contract, the helper was written down as the order's owner instead of the real user. Because the helper lets its owner cancel an order and take the money back, anyone could cancel that order and collect the ether.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

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.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.