Olympus DAO contest - cryptphi'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: 10/147

Findings: 3

Award: $2,283.64

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Findings Information

🌟 Selected for report: Bahurum

Also found by: bin2chen, cryptphi

Labels

bug
duplicate
3 (High Risk)
disagree with severity
sponsor acknowledged

Awards

1714.8718 DAI - $1,714.87

External Links

Lines of code

https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Governance.sol#L265-L289 https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Governance.sol#L240-L262 https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Governance.sol#L205-L236 https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Governance.sol#L180-L201 https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Governance.sol#L159-L176 https://github.com/code-423n4/2022-08-olympus/blob/main/src/modules/VOTES.sol#L1

Vulnerability details

Impact

When all contracts have been deployed and/or initialized, the OlympusVotes contract does not mint an initial token supply. This would allow users to be able to submit proposals, then vote and execute proposals if there has been no token supply (totalSupply = 0) after 1 week of proposal activation.

Proof of Concept

  1. Alice all contracts have been deployed and initialized but admin is yet to issue Votes to users.
  2. Alice submits a proposal and endorses it.
  3. After 1 week, there is still no VOTES toke mint, so still 0 totalSupply.
  4. Alice, activates Proposal, calls votes and executeProposal()
  5. Proposal is executed successfully since the functions will not revert.

Tools Used

Manual review

An initial VOTES token supply should be minted. and to accommodate the initial supply, some changes to the if-statement

if (netVotes * 100 < VOTES.totalSupply() * EXECUTION_THRESHOLD) { revert NotEnoughVotesToExecute(); }

#0 - fullyallocated

2022-09-01T22:13:34Z

Technically correct, but the production version will use a different version of the token that has an initial supply. We can consider adding in a minimum token threshold though for proposal execution

#1 - fullyallocated

2022-09-01T22:29:21Z

Duplicate of #392

Findings Information

🌟 Selected for report: carlitox477

Also found by: cryptphi, ladboy233

Labels

bug
duplicate
2 (Med Risk)

Awards

514.4616 DAI - $514.46

External Links

Lines of code

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

Vulnerability details

Impact

The OlympusGovernance.executeProposal() function makes an external call to kernel contract before updating the state variable activeProposal. This does not follow the CEI pattern and allows the function to be possibly be re-entered to execute the proposal multiple times before the proposal is deactivated.

Proof of Concept

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

Tools Used

Manual review

A non-reentrant modifier or mutex may be necessary. Alternatively, the check-effect-interact pattern should be implemented.

#0 - fullyallocated

2022-09-04T03:12:51Z

Duplicate of #132

  1. Missing zero address check The following are missing checks for zero address.

Occurrences Kernel.executeAction() - is missing zero address validation, allowing the executor and/or admin address to be able to be set to address(0) Kernel.grantRole() - Address(0) can be granted role due to no check for zero address input

  1. Single step critical actionsThe executeAction() function carries out some critical actions which should be broken down into two step calls. e.g change of admin and change of executor

  2. Missing event and emit Policy.setActiveStatus()

  3. Return values ignored Kernel._reconfigurePolicies(Keycode) ignores return value by dependents[i].configureDependencies()

  4. CEI pattern not followed The following functions do not follow the Check-Effect-Interact pattern

Occurrences Kernel.activatePolicy() - calls policy.configureDependencies() before updating state variables Kernel.pruneFromDependents() - calls policy.configureDependencies() before updating state variables OlympusTreasury.repayLoan() in TRSRY.sol - external call token_.safeTransferFrom() before state variables reserveDebt and totalDebt updates. Operator.initialize() - external calls before state variables updates.Operator.operate() - external calls before state variables updates

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