Missing withdrawal pause check in confirmWithdrawal allows bypassing withdrawal restrictions
The confirmWithdrawal function in StakingManager lacks the whenWithdrawalNotPaused modifier, so users can complete withdrawals even after the protocol pauses withdrawals. An attacker with a pending withdrawal request can bypass the pause and withdraw funds during a critical period.
dobrevaleri Follow with 0xd4ps, anchabadze and 7 others
Originally disclosed on Code4rena
Submitted by dobrevaleri, also found by 0xd4ps, anchabadze, Falendar, knight18695, marchev, siddu023, Silverwind, th3_hybrid, and Vibhakar
Vulnerability Details
The StakingManager::confirmWithdrawal() function does not include the whenWithdrawalNotPaused modifier, despite being a withdrawal operation. According to the natspec docs of pauseWithdrawal(), it should pause all withdrawal operations:
/**
* @notice Pause withdrawal operations
*/
function pauseWithdrawal() external onlyRole(MANAGER_ROLE) {
withdrawalPaused = true;
emit WithdrawalPaused(msg.sender);
}
function confirmWithdrawal(uint256 withdrawalId) external nonReentrant whenNotPaused {
uint256 amount = _processConfirmation(msg.sender, withdrawalId);
require(amount > 0, "No valid withdrawal request");
// ...
}
This inconsistency allows users to complete their withdrawal process by calling confirmWithdrawal() even when withdrawals are paused by the protocol. This defeats the purpose of the withdrawal pause functionality which is meant to halt all withdrawal-related operations during critical protocol conditions.
Impact
Users can bypass withdrawal restrictions by confirming existing withdrawal requests during pause
Proof of Concept
- Protocol identifies suspicious activity and calls
pauseWithdrawal() - User with pending withdrawal request calls
confirmWithdrawal() - The withdrawal succeeds despite protocol pause, since missing modifier allows execution
Recommended Mitigation Steps
Add withdrawal pause modifier
- function confirmWithdrawal(uint256 withdrawalId) external nonReentrant whenNotPaused {
+ function confirmWithdrawal(uint256 withdrawalId) external nonReentrant whenNotPaused whenWithdrawalNotPaused {
uint256 amount = _processConfirmation(msg.sender, withdrawalId);
// ...
}
Kinetiq acknowledged
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
Users can bypass withdrawal restrictions by confirming existing withdrawal requests during pause.
What the attacker needed
A pending withdrawal request; withdrawals are paused by the protocol
The fix
The confirmWithdrawal function should be fixed by adding the whenWithdrawalNotPaused modifier.
How it was found
- Protocol identifies suspicious activity and calls pauseWithdrawal()
- User with pending withdrawal request calls confirmWithdrawal()
- The withdrawal succeeds despite protocol pause, since missing modifier allows execution
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract has a pause button meant to stop all withdrawals during emergencies. One function that finalises withdrawals forgot to check that pause button, so people could still take their money out. This means the emergency stop does not fully work.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.