Rubicon contest - Chom's results

An order book protocol for Ethereum, built on L2s.

General Information

Platform: Code4rena

Start Date: 23/05/2022

Pot Size: $50,000 USDC

Total HM: 44

Participants: 99

Period: 5 days

Judge: hickuphh3

Total Solo HM: 11

Id: 129

League: ETH

Rubicon

Findings Distribution

Researcher Performance

Rank: 49/99

Findings: 3

Award: $125.56

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: WatchPug

Also found by: Chom, Dravee, Hawkeye, MaratCerby, Ruhum, csanuragjain, fatherOfBlocks, minhquanym

Labels

bug
duplicate
2 (Med Risk)
sponsor acknowledged

Awards

42.6857 USDC - $42.69

External Links

Lines of code

https://github.com/code-423n4/2022-05-rubicon/blob/8c312a63a91193c6a192a9aab44ff980fbfd7741/contracts/RubiconMarket.sol#L471-L473

Vulnerability details

Impact

isClosed() always return false, which means no one can close the market. If it shouldn't be closed, why this function exists.

isClosed is being used in can_offer, can_buy and can_cancel modifier.

Proof of Concept

isClosed() always return false as seen below.

function isClosed() public pure returns (bool closed) { return false; }

Moreover, isClosed is not overridden in any other lines.

Tools Used

Scan code by eye

Change isClosed to boolean variable and let operator/owner able to assign this variable, guarded by some kind of Timelock.

#0 - bghughes

2022-06-04T20:29:52Z

Intended functionality, acknowledged. We don't want it to every close. #34

#1 - HickupHH3

2022-06-21T04:14:49Z

Not sure about the purpose of having this functionality at all if it's intended to always be open.

#2 - HickupHH3

2022-06-27T14:02:25Z

#339 has a better writeup, making that the primary issue

  • Core contracts are written in solidity >=0.6.0 <0.8.0 which is outdated.
  • You should use solidity 0.8.0, so that you can avoid using SafeMath while overflow/underflow problem is also prevented.
  • You should replace transfer with safeTransfer in SafeERC20 library to prevent non-standard token from ruining your contract.
  • It would be better if you use hardhat since it coming with Proxy helper tools to deploy and upgrade Proxy in standard way.
  • You shouldn't copy standard contracts like ERC20, IERC20 to your project. Instead, import directly from openzeppelin.

  • Change to solidity 0.8.x and avoid using SafeMath. Native solidity safe math engine is better optimized.
  • Use unchecked block on all places where overflow/underflow never happen or has already checked.
AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter