RedemptionVaultWIthBUIDL does not redeem full balance if BUIDL balance is less than 250k post transaction
Source: https://github.com/sherlock-audit/2024-08-midas-minter-redeemer-judging/issues/100
Found by
0xadrii, 0xpiken, Drynooo, Hunter, Ironsidesec, NoOneWinner, WildSniper, eeyore, pashap9990, pkqs90, rzizah
Summary
RedemptionVaultWIthBUIDL does not redeem full balance if BUIDL balance is less than 250k post transaction.
Vulnerability Detail
According to the specs, there should be a feature that when redeeming BUIDL tokens, it should redeem full balance if the remaining BUIDL tokens is less than 250k. However, no such feature is implemented.
Redeem the full BUIDL balance in the smartcontract if the BUIDL balance will be less than 250k post transaction (as 250k is the minimum). Make this 250k threshold a parameter that can be adjusted by the admin
Contest readme states that "Please note that discrepancies between the spec and the code can be reported as issues", thus reporting this as a medium severity issue.
Also, note that this feature is required because BUIDL token has a minimum redemption limit of 250k (according to https://www.steakhouse.financial/projects/blackrock-buidl). Thus lack of this feature may result in lock of BUIDL tokens within the RedemptionVaultWIthBUIDL contract.
However, shares cannot be sold back unless their total value is at least $250,000, or if an exception is granted.
function _checkAndRedeemBUIDL(address tokenOut, uint256 amountTokenOut)
internal
{
uint256 contractBalanceTokenOut = IERC20(tokenOut).balanceOf(
address(this)
);
if (contractBalanceTokenOut >= amountTokenOut) return;
uint256 buidlToRedeem = amountTokenOut - contractBalanceTokenOut;
buidl.safeIncreaseAllowance(address(buidlRedemption), buidlToRedeem);
buidlRedemption.redeem(buidlToRedeem);
}
Impact
- Lock of BUIDL token in RedemptionVaultWIthBUIDL contract.
- Discrepancy between spec and code.
Code Snippet
Tool used
Manual Review
Recommendation
Implement such feature.
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/RedDuck-Software/midas-contracts/pull/68
WangSecurity
@pkqs90 could I get your clarification, this report is specifically about the minimum redemption limit and not about any other limitations, correct?
pkqs90
@pkqs90 could I get your clarification, this report is specifically about the minimum redemption limit and not about any other limitations, correct?
Yes.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity business logic bug in Midas - Instant Minter/Redeemer. Sherlock made it public on 3 September 2024. Found in the 495 audit contest (finding M-2), also found by 10 other wardens.
About Business logic
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
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.