Closed code423n4 closed 2 years ago
The contract owner is going to be a timelock contract which is governed by the DAO through a set of smart contracts (consilium)
The comment on line 138 of VotingEscrow.sol indicates the dev understood and intended the decision. Warden reports on issues that are intentional design choices aren't helpful for the sake of auditing. Marking invalid.
Lines of code
https://github.com/code-423n4/2022-08-fiatdao/blob/5a254ab15a387bd65a7dc50ac8371cb77de1e5d5/contracts/VotingEscrow.sol#L161 https://github.com/code-423n4/2022-08-fiatdao/blob/5a254ab15a387bd65a7dc50ac8371cb77de1e5d5/contracts/VotingEscrow.sol#L170 https://github.com/code-423n4/2022-08-fiatdao/blob/5a254ab15a387bd65a7dc50ac8371cb77de1e5d5/contracts/VotingEscrow.sol#L652-L658
Vulnerability details
Compromised or malicious owner can lead into unexpected withdrawals
Impact
An scenario where ownership is compromised or a malicious owner appears can lead into:
unlock
function to turn themaxPenalty
into 0 (this function is irreversible and have no timelock)blocklist
(for example himself) that can force undelegationspenaltyRecipient
to some address he owns andcollectPenalty
References
https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/ https://blog.openzeppelin.com/opyn-gamma-protocol-audit/
Proof of Concept
unlock
: https://github.com/code-423n4/2022-08-fiatdao/blob/5a254ab15a387bd65a7dc50ac8371cb77de1e5d5/contracts/VotingEscrow.sol#L161forceUndelegate
: https://github.com/code-423n4/2022-08-fiatdao/blob/5a254ab15a387bd65a7dc50ac8371cb77de1e5d5/contracts/VotingEscrow.sol#L170quitLock
(maxPenalty
used by calling_calculatePenaltyRate
) https://github.com/code-423n4/2022-08-fiatdao/blob/5a254ab15a387bd65a7dc50ac8371cb77de1e5d5/contracts/VotingEscrow.sol#L652-L658penaltyRecipient
https://github.com/code-423n4/2022-08-fiatdao/blob/5a254ab15a387bd65a7dc50ac8371cb77de1e5d5/contracts/VotingEscrow.sol#L153-L157collectPenalties
https://github.com/code-423n4/2022-08-fiatdao/blob/5a254ab15a387bd65a7dc50ac8371cb77de1e5d5/contracts/VotingEscrow.sol#L672-L678Recommended Mitigation Steps