Smart Security Practices From The Best
What do Lido, Red Stone, YieldNest, and Braintrust have in common? They’ve developed effective methods for improving security without drastically increasing costs. Top-tier protocol […]
This issue prevents the successful withdrawal of assets based on the values returned by the ERC4626 functions and their equivalent versions for different assets.
The KernelStrategy implementations allow for the withdrawal of all supported assets, as opposed to Max Vaults that can only withdraw the base asset. These strategies are designed to comply with ERC4626 by implementing its functions (such as maxWithdraw, maxRedeem, previewWithdraw, and previewRedeem).
In addition, they also incorporate similar functions that handle assets beyond just the base asset, namely maxWithdrawAsset, previewWithdrawAsset, and previewRedeemAsset.
A key issue with these functions is their assumption that all shares in the strategy were minted for a single asset. For instance, when the maxWithdraw function is invoked, the contract presumes that all shares correspond to the base asset, potentially resulting in an inflated withdrawal amount as it neglects to consider that the amount needs to be apportioned among multiple assets.
The following sequence of actions may lead to the identified problem:
maxWithdrawAsset function for BNBX.withdrawAsset function using the amount provided.previewWithdrawAsset function.MEDIUM – This issue prevents the successful withdrawal of assets based on the values returned by the ERC4626 functions and their equivalent versions for different assets.
Implement a method to track the amount of deposited assets for each asset type in addition to the totalAssets variable, and utilize this information within the affected functions.
Meet Composable Security
Get throughly tested by the creators of Smart Contract Security Verification Standard
Let us help
Get throughly tested by the creators of Smart Contract Security Verification Standard