Closed code423n4 closed 2 years ago
Duplicate: https://github.com/code-423n4/2022-09-artgobblers-findings/issues/431
We have to assume the owner is the community or the team itself (e.g.: multisig or governance contract). Therefore I think these findings are invalid.
The presence or absence of a multisig are not in-scope because the Sponsor could lie / cannot be falsified https://github.com/code-423n4/org/issues/7 https://github.com/code-423n4/org/issues/11
The contract allows the "owner" to transfer to any address, it works as intended and no abnormal behaviour was shown.
Lines of code
https://github.com/code-423n4/2022-09-artgobblers/blob/main/src/utils/GobblerReserve.sol#L34-L41 https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol#L19-L23 https://github.com/code-423n4/2022-09-artgobblers/blob/main/script/deploy/DeployBase.s.sol#L61-L105
Vulnerability details
Impact
The following
withdraw
function can be called by the owner of the team or community reserve contract to withdraw gobblers from the reserve to a receiving address of choice as allowed by theonlyOwner
modifier below. As therun
function below in theDeployBase
contract shows, the team's cold wallet is used as this owner after deployment. If the owner of the team's cold wallet becomes compromised or malicious in the future, such owner can callwithdraw
to withdraw specified gobblers from the respective reserve to a specified receiving address, which takes effect immediately. As a result, the team or community reserve loses these reserved gobblers in an unauthorized way. Although this risk might be somewhat acceptable to the team since the team has the responsibility to protect its own cold wallet, it is unfair to the community in which it loses its reserved gobblers because it is affected by another party's decision that is not under its control.https://github.com/code-423n4/2022-09-artgobblers/blob/main/src/utils/GobblerReserve.sol#L34-L41
https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol#L19-L23
https://github.com/code-423n4/2022-09-artgobblers/blob/main/script/deploy/DeployBase.s.sol#L61-L105
Proof of Concept
Please append the following test in
test\GobblerReserve.t.sol
. This test will pass to demonstrate the described scenario.Tools Used
VSCode
Recommended Mitigation Steps
At least for running the
withdraw
function for the community reserve, a governance mechanism could be set up for the community to vote and decide on whetherwithdraw
can be called or not, instead of allowing the owner of the community reserve contract to directly callwithdraw
.