sherlock-audit / 2023-02-fair-funding-judging

1 stars 0 forks source link

csanuragjain - Break contract functionalities #77

Closed github-actions[bot] closed 1 year ago

github-actions[bot] commented 1 year ago

csanuragjain

medium

Break contract functionalities

Summary

It is possible for operator to remove himself. This will have the contract without any operator. This becomes problem since all functionalities requiring operator role will stop working

Vulnerability Detail

  1. Operator O1 is existing
  2. Operator O1 removes itself by calling remove_operator function
def remove_operator(_to_remove: address):
    """
    @notice
        Remove an existing operator from the priviledged addresses.
    """
    assert self.is_operator[msg.sender], "unauthorized"
    assert self.is_operator[_to_remove], "not an operator"

    self.is_operator[_to_remove] = False

    log OperatorRemoved(_to_remove, msg.sender)
  1. Now no operator is present in contract.
  2. This directly impact function like add_depositor , set_alchemist , set_fund_receiver etc which cannot be called now (callable by operator only)

Impact

Any functionality requiring operator role will not work

Code Snippet

https://github.com/sherlock-audit/2023-02-fair-funding/blob/main/fair-funding/contracts/Vault.vy#L604

Tool used

Manual Review

Recommendation

operator should not be allowed to remove himself and one operator should always remain in system

Duplicate of #46