Kicking is still possible and kick rewards accessible while in shutdown #331
Labels
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
duplicate
This issue or pull request already exists
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Lines of code
https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/AuraLocker.sol#L386-L389
Vulnerability details
kickExpiredLocks is still allowed to be successfully run when
locks[length - 1].unlockTime <= block.timestamp - rewardsDuration.mul(kickRewardEpochDelay)
even when the system is in Shutdown.This way once the system go to shutdown a malicious user can setup a bot that runs kickExpiredLocks immediately after the condition becomes true. This can be unexpected by lock owner as only funds withdrawals should be facilitated in the shutdown mode, while other mechanics are to be stopped.
Setting severity to medium as that's a divergence from expected behaviour of the system.
Proof of Concept
isShutdown
part condition is meaningless when_checkDelay > 0
:https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/AuraLocker.sol#L386-L389
As if
locks[length - 1].unlockTime > expiryTime
then the L402 will revert on subtraction as it will becurrentEpoch < uint256(locks[length - 1].unlockTime)
:https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/AuraLocker.sol#L396-L405
I.e.
locks[length - 1].unlockTime <= expiryTime
is de facto required in all the cases and the system behavior for kicking doesn't change on shutdown, with the only difference that it will be low level error.Recommended Mitigation Steps
Consider reverting kicks when the system is in shutdown:
https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/AuraLocker.sol#L346-L349
The text was updated successfully, but these errors were encountered: