You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2023. It is now read-only.
github-actionsbot opened this issue
Feb 23, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
is_operator has problems in mapping architecture design in the following detail, is_operator Although there is a risk of centrality, it has been evaluated out of centrality due to the authorization of the newly defined operators and the invalidity of the contract.
Operators can be defined with add_operator, operators can be removed with remove_operator;
contracts/Vault.vy:
623624: @external625: def add_operator(_new_operator: address):
626: """ 627: @notice 628: Add a new address to the priviledged operators. 629: """630: assertself.is_operator[msg.sender], "unauthorized"631: assertself.is_operator[_new_operator] ==False, "already operator"632:
633: self.is_operator[_new_operator] =True634:
635: log NewOperator(_new_operator, msg.sender)
636:
637:
638: @external639: def remove_operator(_to_remove: address):
640: """ 641: @notice 642: Remove an existing operator from the priviledged addresses. 643: """644: assertself.is_operator[msg.sender], "unauthorized"645: assertself.is_operator[_to_remove], "not an operator"646:
647: self.is_operator[_to_remove] =False648:
649: log OperatorRemoved(_to_remove, msg.sender)
This architecture has some problem for contract actions;
is_operator can define itself as msg.sender at the beginning, then remove it with remove_operator and in such case no important functions can be used in the project
Functions that cannot be used in this case; def add_depositor() def remove_depositor() def set_alchemist def set_fund_receiver def add_operator() def remove_operator()
is_operator can define itself as msg.sender at the beginning, then add a new operator with add_operator and remove the main operator defined in __init__ with the newly added operator remove_operator (I don't think this is a desired architecture)
Impact
638: @external639: def remove_operator(_to_remove: address):
640: """ 641: @notice 642: Remove an existing operator from the priviledged addresses. 643: """644: assertself.is_operator[msg.sender], "unauthorized"645: assertself.is_operator[_to_remove], "not an operator"646:
647: self.is_operator[_to_remove] =False648:
649: log OperatorRemoved(_to_remove, msg.sender)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
0xSmartContract
medium
is_operator
architecture is wrongSummary
is_operator
has problems in mapping architecture design in the following detail,is_operator
Although there is a risk of centrality, it has been evaluated out of centrality due to the authorization of the newly defined operators and the invalidity of the contract.Vulnerability Detail
is_operator
is hashMap for operators register.First defined initially as state variable;
At this point , first operator is defined in
__init__
function with msg.sender;Operators can be defined with
add_operator
, operators can be removed withremove_operator
;This architecture has some problem for contract actions;
is_operator
can define itself as msg.sender at the beginning, then remove it withremove_operator
and in such case no important functions can be used in the projectFunctions that cannot be used in this case;
def add_depositor()
def remove_depositor()
def set_alchemist
def set_fund_receiver
def add_operator()
def remove_operator()
is_operator
can define itself as msg.sender at the beginning, then add a new operator withadd_operator
and remove the main operator defined in__init__
with the newly added operatorremove_operator
(I don't think this is a desired architecture)Impact
Code Snippet
Vault.vy#L631-L642
Tool used
Manual Review
Recommendation
Duplicate of #46
The text was updated successfully, but these errors were encountered: