code-423n4 / 2022-01-sherlock-findings

0 stars 0 forks source link

Updating Manager contract could destruct Sherlock core functionalities #201

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

ych18

Vulnerability details

In Sherlock core contract, it is possible to update some contracts like Manager using Sherlock.updateSherlockProtocolManager function. Some functions in other contracts use the onlySherlockCore modifier that checks if the function is called from the Sherlock core contract. Updating the Manager contract will set the address of sherlockCore to 0 in the new Manager contract. The DEPLOYER should call the function Manager.setSherlockCoreAddress to set the value of the core contract in the new Manager contract. If the DEPLOYER forget to call setSherlockCoreAddress, some functions in the new contract will revert as the condition in the onlySherlockCore is not satisfied.

Recommendation: ( the team could choose between these two recommendations) -1)add comments in Sherlock.updateSherlockProtocolManager that indicates the setSherlockCoreAddress should be called after calling this function.

Evert0x commented 2 years ago

0 non critical

Will add comments thanks