The emergencyClose
function is intended to be a final measure to repay all debts and shut down the vault permanently, as indicated by the function's documentation. This action should be irreversible to ensure the finality and security of the vault's emergency closure process.
However, a pathway exists to effectively reopen a vault after it has been closed using emergencyClose
by invoking the emergencyPause
and emergencyResume
functions. These functions alter the vault's status, allowing for the resumption of operations which contradicts the intended irreversible nature of an emergency close.
The impact of this finding is significant, as it undermines the trust model of the emergency close process. Users and stakeholders expect that once a vault is closed in an emergency, it will remain closed as a protective measure. The ability to resume operations after an emergency closure could expose the vault to additional risks and potentially be exploited by malicious actors, especially if the original closure was due to a security threat.
Add this to GMXEmergencyTest.t.sol and test with forge test --mt test_close_then_pause -vv
:
Implement a permanent state or flag within the vault's storage to irrevocably mark the vault as closed after emergencyClose
is called. This flag should prevent any further state-altering operations.
Modify the emergencyPause
and emergencyResume
functions to check for this permanent closure flag and revert if the vault has been emergency closed.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.