Platform: Code4rena
Start Date: 30/04/2024
Pot Size: $112,500 USDC
Total HM: 22
Participants: 122
Period: 8 days
Judge: alcueca
Total Solo HM: 1
Id: 372
League: ETH
Rank: 47/122
Findings: 1
Award: $18.20
🌟 Selected for report: 0
🚀 Solo Findings: 0
18.1958 USDC - $18.20
Loss of user Funds.
/// @dev Allows restake manager to remove a collateral token function removeCollateralToken( IERC20 _collateralTokenToRemove ) external onlyRestakeManagerAdmin { // Remove it from the list uint256 tokenLength = collateralTokens.length; for (uint256 i = 0; i < tokenLength; ) { if (address(collateralTokens[i]) == address(_collateralTokenToRemove)) { collateralTokens[i] = collateralTokens[collateralTokens.length - 1]; collateralTokens.pop(); emit CollateralTokenRemoved(_collateralTokenToRemove); return; } unchecked { ++i; } } // If the item was not found, throw an error revert NotFound(); }
In the protocol, the admin has the power to add and remove collateral tokens. Here, the crucial part is to remove the collateral token. Using removeCollateralToken
function, the admin removes the addresses that have funds invested by users. This function doesn't check the current available balance of the protocol.
Here is the steps
how it may accure :
Users deposit in RestakeManager.sol using the deposit function.
After a large chunk of money exists in the protocol, the admin removes the collateral address.
The user requests to withdraw collateral using the withdraw function.
The fund is in a cooling period. After the cooling period, the user calls the claim function, but it doesn't exist at that point.Â
check the current balance when remove
Other
#0 - c4-judge
2024-05-17T13:59:26Z
alcueca marked the issue as not a duplicate
#1 - c4-judge
2024-05-17T13:59:42Z
alcueca marked the issue as duplicate of #271
#2 - c4-judge
2024-05-17T14:04:31Z
alcueca marked the issue as duplicate of #97
#3 - c4-judge
2024-05-17T14:05:46Z
alcueca marked the issue as unsatisfactory: Invalid
#4 - c4-judge
2024-05-20T04:34:14Z
alcueca changed the severity to 2 (Med Risk)
#5 - c4-judge
2024-05-20T04:41:21Z
alcueca marked the issue as satisfactory