-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkqs90 - MBasisRedemptionVaultWithSwapper does not update mBasis daily limit or allowance when conducting mBasis->mTBill swap. #110
Comments
1 comment(s) were left on this issue during the judging contest. merlinboii commented:
|
Escalate
As we can see, in the above case no |
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
The protocol team fixed this issue in the following PRs/commits: |
@pkqs90 could I get your input on this? |
@WangSecurity My response to the escalation:
|
Thank you for the response, I agree that indeed Hence, planning to reject the escalation and leave the issue as it is. |
@WangSecurity While, the
Hence, isuue is of low severity. |
@IronsideSec thank you very much. While I see how it breaks the functionality of the protocol, i.e. the daily limit is not decreased as it should be, there is indeed to loss of funds. But, to be medium severity issue it shouldn't lead to a loss of funds necessarily:
And I think @pkqs90 could help us how updating the daily limit on instant redeems is important for the protocol? |
True, but below statement is wrong
But here So, So, not updating the daily limit on mBasis to mToken swap action doesn't break any core functionality of the protocol. |
Users can instant redeem more mBasis than the daily limit config set by admin. This is a direct violation of the specs. Same mechanism has been implemented for all redemption vaults except
As for why the limit is required, I suggest asking the protocol team. But IIRC, violating the specs is enough for a valid medium. Also my response to @IronsideSec on the "bypass mechanism" to feed
For the second case, it already violates the spec, not to mention the complicated scenario where we have multiple tokenOuts, and that mToken:mBasis is a fluctuating rate. I don't think the bypass mechanism is realistic. |
Conclusion from me :
its easy to have a backend bot to change mTbill balance of liquidity provider to adjust limits accordingly. Its realistic. |
It is worth mentioning that Midas protocol asked in the Readme to report all the issues that break the spec. Here:
And here:
|
This is an invalid statement; suggesting that limiting mBASIS redemption by updating the mTBILL redemption limit is more than just incorrect. The mTBILL redemption vault operates independently from mBASIS redemption.
This is also an invalid statement; it can be seen as a global redemption limit, not a daily one, and can be easily broken. Let's now break down both suggested ways to limit mBASIS redemption proposed by @IronsideSec: The user has 550 mBASIS to redeem.
With the current code and the proposed solution, both transactions still pass, breaking the mBASIS redemption limit of 500. And the core functionality that is broken is the breaking the daily mBASIS token redemption limit, in highly regulated RAW protocol it is more than needed. |
Replying to @0xklapouchy
I explained here why its not breaking the spec at all. Spec says admin can adjust the global parameters (i.e can change redemption limits). Admin can still change the limit. Hence, not breaking any spec. Your issue is suggesting to modify both mbasis and mToken limits and not only mToken's, when mbasis -> mTbill swap redemption is done. How is this breaking functionality ? Not violating the spec at all. Even if as explained points in the just above comment, invalidating the mechanism bot explained here doesn't make this issue
Doesn't matter. Admin can stall the balance of liquidity provider to zero to completely block the
Even if you claim its a core functionality, admin has lots of ways to limit the mBasis to mTbill, (mTbill balance of liquidity provider, redemption limit on mTbill itself). The fix of this issue just makes things easier. Its a low impact @WangSecurity |
I fully agree with @0xklapouchy's point above. My response to @IronsideSec's point "its easy to have a backend bot to change mTbill balance of liquidity provider to adjust limits accordingly. Its realistic.":
My response to @IronsideSec's point "Even if you claim its a core functionality, admin has lots of ways to limit the mBasis to mTbill, (mTbill balance of liquidity provider, redemption limit on mTbill itself)":
|
@pkqs90 @0xklapouchy You guys are invalidating the bot mechanism and the other methods to limit swap redemption But,
|
Firstly, to clarify, the medium doesn't say "core functionality", it says "core contract functionality", i.e. the functionality of the core contract. I get that it's a bit confusing, therefore, wanted to clarify. Secondly, I agree with @pkqs90 that bots were not mentioned anywhere and we shouldn't assume they will be used. In this case, it's a hypothetical way to mitigate the issue, which has also been proved to be not working. Thirdly, about breaking the spec. Let's look at the entire section about caps:
As we can see there's an example where the cap is set and reaching this limit shouldn't allow more instant mints. Similarly to it, if the limit is reached, instant redemptions shouldn't be allowed. Here, in this issue, this limit can be reached but the redemptions will continue, because it doesn't track the redemptions involving mBasis correctly. Therefore, I agree the spec is broken here. Hence, planning to reject escalation and leave the issue as it is.
|
Result: |
Escalations have been resolved successfully! Escalation status:
|
pkqs90
Medium
MBasisRedemptionVaultWithSwapper does not update mBasis daily limit or allowance when conducting mBasis->mTBill swap.
Summary
MBasisRedemptionVaultWithSwapper does not update mBasis daily limit or allowance when conducting mBasis->mTBill swap.
Vulnerability Detail
When users are redeeming from
MBasisRedemptionVaultWithSwapper
, if there is not enoughtokenOut
balance, it will first conduct a mBasis->mTBill swap and try to redeem from the mTBill redemption vault.The issue here is, when this happens, the daily limit and token allowance is only deducted from the mTBill redemption vault, and not the original
MBasisRedemptionVaultWithSwapper
contract.Impact
mBasis daily limit and token allowance does not deduct as expected.
Code Snippet
Tool used
Manual Review
Recommendation
Also update mBasis daily limit and allowance when conducting mBasis->mTBill swap for
MBasisRedemptionVaultWithSwapper
.The text was updated successfully, but these errors were encountered: