code-423n4 / 2022-07-yield-findings

0 stars 0 forks source link

QA Report #89

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Low Risk

  1. Missing pause functionality
  2. Missing zero address checks
  3. Critical address change

Non-Critical

  1. Usage of not well-tested solidity version might contain undiscovered vulnerabilities
  2. Missing/incomplete natspec comments

1. Missing pause functionality

Risk

Low

Impact

Contract Witch is missing pause functionality that could be used in case of security incidents and would block executing selected functions while the contract is paused.

Proof of Concept

Witch.sol:

Tools Used

Manual Review / VSCode

Recommended Mitigation Steps

It is recommended to add functionality for pausing contract Witch and go through all publicly/externally accessible functions to decide which one should be forbidden from running while the contract is paused.

2. Missing zero address checks

Risk

Low

Impact

Multiple functions of Witch contract do not check for zero addresses which might lead to loss of funds, failed transactions and can break the protocol functionality.

Proof of Concept

Witch.sol:

Tools Used

Manual Review / VSCode

Recommended Mitigation Steps

It is recommended to add zero address checks for listed parameters.

3. Critical address change

Risk

Low

Impact

Changing critical addresses such as ownership should be a two-step process where the first transaction (from the old/current address) registers the new address (i.e. grants ownership) and the second transaction (from the new address) replaces the old address with the new one. This gives an opportunity to recover from incorrect addresses mistakenly used in the first step. If not, contract functionality might become inaccessible.

Proof of Concept

Witch.sol:

Tools Used

Manual Review / VSCode

Recommended Mitigation Steps

It is recommended to implement two-step process for changing ownership.

4. Usage of not well-tested solidity version might contain undiscovered vulnerabilities

Risk

Non-Critical

Impact

Using the latest versions might make contracts susceptible to undiscovered compiler bugs.

Proof of Concept

Tools Used

Manual Review / VSCode

Recommended Mitigation Steps

It is recommended to use more stable and tested solidity version such as 0.8.10.

5. Missing/incomplete natspec comments

Risk

Non-Critical

Impact

Contract Witch is missing natspec comments which makes code more difficult to read and prone to errors.

Proof of Concept

Witch.sol:

Tools Used

Manual Review / VSCode

Recommended Mitigation Steps

It is recommended to add missing natspec comments.

alcueca commented 2 years ago

Thanks for the suggestion for a pause functionality, and for the natspec check. Nothing else is useful or correct.