updateOperator()
can be called before an operator is set in proxy
#34
Labels
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
G (Gas Optimization)
resolved
Finding has been patched by sponsor (sponsor pls link to PR containing fix)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/Aura.sol#L82
Vulnerability details
Impact
In
Aura.sol
theupdateOperator()
function can be called by anyone and it sets a newoperator
based on the address returned fromIStaker(vecrvProxy).operator()
. The problem is that anyone can call this function even if the operator onvecrvProxy
is not yet set. If this is the case the operator inAura.sol
would be set to a zero address breaking the contract since functions likeinit()
andmint()
rely on themsg.sender
being theoperator
. Even theminterMint()
function relies on theoperator
since only the operator can set theminter
which is the only one who can callminterMinter()
.Proof of Concept
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/Aura.sol#L82
Tools Used
Manual code review
Recommended Mitigation Steps
The
updateOperator()
function should not be a public function and should only be callable by an admin or theoperator
insideAura.sol
. Also in theupdateOperator()
function, there should be a check ensuring that thenewOperator
address is not a zero address to prevent breaking the contract by setting theoperator
to a zero address.The text was updated successfully, but these errors were encountered: