Olympus DAO contest - itsmeSTYJ's results

Version 3 of Olympus protocol, a decentralized floating currency.

General Information

Platform: Code4rena

Start Date: 25/08/2022

Pot Size: $75,000 USDC

Total HM: 35

Participants: 147

Period: 7 days

Judge: 0xean

Total Solo HM: 15

Id: 156

League: ETH

Olympus DAO

Findings Distribution

Researcher Performance

Rank: 23/147

Findings: 5

Award: $1,040.98

๐ŸŒŸ Selected for report: 0

๐Ÿš€ Solo Findings: 0

Findings Information

๐ŸŒŸ Selected for report: GalloDaSballo

Also found by: PwnPatrol, cccz, itsmeSTYJ

Labels

bug
duplicate
2 (Med Risk)
sponsor confirmed

Awards

347.2615 DAI - $347.26

External Links

Lines of code

https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Heart.sol#L106

Vulnerability details

Impact

If there are insufficient rewards remaining in the contract, _issueReward() will fail to transfer and thus beat() cannot be called. Again, there is an assumption that there will always be sufficient rewards in the contract but it is prudent to not assume otherwise.

Transfer the minimum between the amount of reward to be paid and the token balance of the contract i.e.

function min(uint256 a, uint256 b) internal returns (uint256) { if(a < b) return a; return b; } function _issueReward(address to_) internal { uint256 balance = rewardToken.balanceOf(address(this)); uint256 amt = min(balance, reward); rewardToken.safeTransfer(to_, amt); emit RewardIssued(to_, amt); }

#0 - Oighty

2022-09-07T20:37:39Z

See comment on #390.

#1 - Oighty

2022-09-07T20:44:00Z

See comment on #378 as well.

#2 - 0xean

2022-09-19T14:35:09Z

closing as duplicate of #378

Findings Information

๐ŸŒŸ Selected for report: hansfriese

Also found by: datapunk, itsmeSTYJ

Labels

bug
duplicate
2 (Med Risk)
disagree with severity

Awards

514.4616 DAI - $514.46

External Links

Lines of code

https://github.com/code-423n4/2022-08-olympus/blob/main/src/modules/RANGE.sol#L97-L98

Vulnerability details

Impact

If cushion spread is > wall spread, the entire contracts are bricked because it operates on the assumption that the cushion spread is strictly less than wall spread. Do note that this is only a problem in the constructor i.e. the setSpreads() function contains this validation check.

Require that the cushion spread is < wall spread.

#0 - Oighty

2022-09-07T21:37:08Z

See comment on #379

#1 - 0xean

2022-09-19T14:18:35Z

closing as dupe of #379 379

Findings Information

Awards

11.0311 DAI - $11.03

Labels

bug
duplicate
2 (Med Risk)
sponsor confirmed

External Links

Lines of code

https://github.com/code-423n4/2022-08-olympus/blob/main/src/modules/PRICE.sol#L167 https://github.com/code-423n4/2022-08-olympus/blob/main/src/modules/PRICE.sol#L173

Vulnerability details

Impact

It is possible that an incorrect value for currentPrice is used when latestRoundData() is called because no validation is done on the roundId and that price cannot be 0. Do note that the impact is somewhat minimized because a simple moving average is used but it is still prudent to add these validation checks to ensure that the protocol reflects the most up-to-date and correct price for OHMv2 and the reserve token.

check that the roundId is increasing and that price is > 0.

#0 - Oighty

2022-09-06T18:55:10Z

Duplicate. See comment on #441.

Findings Information

๐ŸŒŸ Selected for report: rvierdiiev

Also found by: Jeiwan, Lambda, Trust, datapunk, devtooligan, itsmeSTYJ, zzzitron

Labels

bug
duplicate
2 (Med Risk)
sponsor confirmed

Awards

113.9192 DAI - $113.92

External Links

Lines of code

https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Heart.sol#L103

Vulnerability details

Impact

It is possible to call beat() multiple times consecutively because lastBeat is not correctly tracked.

Proof of Concept

Assume the current timestamp is 1000 and the observation frequency is 100. beat() is called once and lastBeat is updated to 1100 which is correct. Assume that 323 seconds have passed i.e. the current time is now 1423. It is now possible to call beat() another 4 more times since lastBeat is always incremented by observation frequency.

Replace lastBeat += frequency(); with lastBeat = block.timestamp + frequency();

#0 - Oighty

2022-09-07T21:03:38Z

See comment on #405 and #79.

#1 - 0xean

2022-09-19T13:28:05Z

closing as dupe of #79

Lines of code

https://github.com/code-423n4/2022-08-olympus/blob/main/src/modules/PRICE.sol#L32-L33

Vulnerability details

Impact

Should anything happen to chainlink oracles e.g. pausing of price feed, error in configuration or even when gas prices are too high, the protocolโ€™s functionality would be halted as there are no fallback oracles to rely on.

  • Introduce a fallback oracle and periodically ensure that fallback oracle is working.
  • Introduce pausing functionality as a last resort.

#0 - Oighty

2022-09-06T18:59:06Z

We recognize this as a potential issue, but there are no additional oracle sources that are sufficient for our uses currently. We anticipate revisiting this after some protocol level decisions are implemented with respect to the primary liquidity pools for OHM.

Currently, mitigations are in place to prevent loss of funds by reverting stale price feed calls (which are going to be improved upon per #441, et al).

#1 - 0xean

2022-09-16T18:54:06Z

downgrading to QA.

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