Closed c4-bot-10 closed 10 months ago
alex-ppg marked the issue as primary issue
alex-ppg marked the issue as insufficient quality report
kupermind (sponsor) disputed
dmvt marked the issue as unsatisfactory: Invalid
Dear Judge, Due to #437 being valid, it seems that the present issue was disputed/invalidated by accident which is pretty understandable as it has also happened to me when judging.
Nevertheless, a few aspects to provide an overview:
GuardCM
contract). This guard has an (un-)pausing mechanism that temporarily allows the CM unrestricted control over the protocol.Kind regards,
0xTheC0der
Privilege escalation issues are judged by likelihood and impact and their severity is uncapped.
For both issues, we have to assume that the CM is maliciously controlled, which is unlikely IMO. However, with #437 if at any point it is, there is no way to prevent it from taking full control and no time to notice that this has happened. With this issue, the CM has to be malicious, and unnoticed until an event severe enough to trigger a pause. Then it needs to act quickly and collect signatures prior to an unpause. I view this as a highly unlikely string of events. IMO, this issue should have been included as a QA or admin risk in Analysis.
Lines of code
https://github.com/code-423n4/2023-12-autonolas/blob/2a095eb1f8359be349d23af67089795fb0be4ed1/governance/contracts/multisigs/GuardCM.sol#L427-L429 https://github.com/code-423n4/2023-12-autonolas/blob/2a095eb1f8359be349d23af67089795fb0be4ed1/governance/contracts/multisigs/GuardCM.sol#L400
Vulnerability details
Impact
The
GuardCM
contract is designed to restrict the Community Multisig (CM) actions within the protocol to only specific contracts and methods. Under specific circumstances, the protocol allows the guard to be paused, which temporarily pauses the guard and provides the CM with full access to the timelock.However, a potential vulnerability in the current implementation allows the CM to exploit a pause in
GuardCM
to gain permanent unrestricted access. This is because self-calls are only disallowed when the contract is not paused. If it is paused,checkTransaction
simply always passes. This means that the CM can take advantage of an event that causes governance to pause the guard, callsetGuard()
on itself and remove the guard altogether. This would effectively give the CM permanent unrestricted access, bypassing the guard's restrictions.The CM holds all privileged roles within the timelock, which is the protocol owner. This means that the CM can potentially gain permanent unrestricted control over the entire protocol. As such, this vulnerability represents a significant risk of privilege escalation and is classified as high severity.
Proof of Concept
The following sequence of events could lead to the CM gaining unrestricted access:
GuardCM
contract.GuardCM
contract is paused, the CM executessetGuard(0)
on itself.setGuard()
function removes the guard from the CM.Tools Used
Manual review
Recommended Mitigation Steps
To mitigate this issue, it is recommended to implement checks for self-calls even when the contract is paused. This would prevent the CM from being able to call the
setGuard()
function on itself and remove the guard:Assessed type
Access Control