KangarooVault.initiateDeposit
, KangarooVault.processDepositQueue
, KangarooVault.initiateWithdrawal
, and KangarooVault.processWithdrawalQueue
functions do not use whenNotPaused
modifier
#232
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
M-03
primary issue
Highest quality submission among a set of duplicates
selected for report
This submission will be included/highlighted in the audit report
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/KangarooVault.sol#L19-L21
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/KangarooVault.sol#L183
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/KangarooVault.sol#L243
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/KangarooVault.sol#L215
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/KangarooVault.sol#L269
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L184
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L200-L205
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L219
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L247
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L264-L269
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L284
Vulnerability details
Impact
As shown by the code below, although
PauseModifier
is imported, theKangarooVault
contract does not use thewhenNotPaused
modifier in any of its functions. More specifically, theKangarooVault.initiateDeposit
,KangarooVault.processDepositQueue
,KangarooVault.initiateWithdrawal
, andKangarooVault.processWithdrawalQueue
functions do not use thewhenNotPaused
modifier.https://github.com/code-423n4/2023-03-polynomial/blob/main/src/KangarooVault.sol#L19-L21
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/KangarooVault.sol#L183
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/KangarooVault.sol#L243
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/KangarooVault.sol#L215
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/KangarooVault.sol#L269
This is unlike the
LiquidityPool
contract; comparing to theKangarooVault.initiateDeposit
,KangarooVault.processDepositQueue
,KangarooVault.initiateWithdrawal
, andKangarooVault.processWithdrawalQueue
functions, theLiquidityPool.deposit
,LiquidityPool.queueDeposit
,LiquidityPool.processDeposits
,LiquidityPool.withdraw
,LiquidityPool.queueWithdraw
, andLiquidityPool.processWithdraws
functions have the similar functionalities but they all use thewhenNotPaused
modifier. As a result, when an emergency, such as a hack, occurs, the protocol can pause theLiquidityPool.withdraw
,LiquidityPool.queueWithdraw
, andLiquidityPool.processWithdraws
functions to prevent or reduce damages, such as preventing users and the protocol from losing funds, but cannot do that for theKangarooVault.initiateDeposit
,KangarooVault.processDepositQueue
,KangarooVault.initiateWithdrawal
, andKangarooVault.processWithdrawalQueue
functions.https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L184
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L200-L205
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L219
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L247
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L264-L269
https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L284
Proof of Concept
The following steps can occur for the described scenario.
LiquidityPool.withdraw
,LiquidityPool.queueWithdraw
, andLiquidityPool.processWithdraws
functions.KangarooVault.initiateWithdrawal
andKangarooVault.processWithdrawalQueue
functions.KangarooVault
.Tools Used
VSCode
Recommended Mitigation Steps
The
KangarooVault.initiateDeposit
,KangarooVault.processDepositQueue
,KangarooVault.initiateWithdrawal
, andKangarooVault.processWithdrawalQueue
functions can be updated to use thewhenNotPaused
modifier.The text was updated successfully, but these errors were encountered: