-
Notifications
You must be signed in to change notification settings - Fork 4
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
Bauchibred - Protocol inflates the amount of tokens received when depositing for some tokens #10
Comments
Escalate. On @Bauchibred Behalf. |
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. |
vault doesn't support stETH but supports wstETH |
I believe the report is incorrect. The issue wouldn't result in inflated lp tokens, the issue results in the revert on deposit, so the impact is incorrect here, since it cannot be reached. Planning to reject the escalation and leave the issue as it is. |
What do you mean? How does it revert on deposit? Note that I hinted this to be a dup of #299, cause they both are talking about the Pending your further explanation, I assume your current confusion is from you considering the snippets to be similar with #299? In that case there is a conversion occurring and the |
@Bauchibred sir, vaults doesn't support stETH as |
@Bauchibred is correct, I've overlooked and made an incorrect comment. But as I understand based on the @IlIlHunterlIlI , which is correct, the problem described in this report, wouldn't happen with stETH in the Hence, if the above assumption is correct, the decision is to reject the escalation and leave the issue as it is. |
Hey @WangSecurity, thanks for providing this link, missed this info during the audit as I wasn't active on discord, so I assumed any whitelisted token could be used as underlying. With this, I believe @IlIlHunterlIlI is right that the vaults don't support |
Result: |
Escalations have been resolved successfully! Escalation status:
|
Bauchibred
High
Protocol inflates the amount of tokens received when depositing for some tokens
Summary
Protocol inflates the amount of tokens received when depositing for some tokens
Vulnerability Detail
The readMe hints that the supported tokens are steth, weth & wsteth.
Now when depositing there is an instance where the amount of lp to process for the deposit is being processed, and in this instance, there is a need to route through all the tokens that are to be deposited and then calculate the
depositValue
which ends up being used to process the lp amounts, see https://github.com/sherlock-audit/2024-06-mellow/blob/26aa0445ec405a4ad637bddeeedec4efe1eba8d2/mellow-lrt/src/Vault.sol#L322-L338Would be key to note that
stETH
is not a fee on transfer token, however it is a special token when it comes to it's transfer logic, navigating to lido's official docs we can see that there is a special section that talks about it's unique concept, i.e the "1-2 wei corner case", see https://docs.lido.fi/guides/lido-tokens-integration-guide/#1-2-wei-corner-case, quoting them:What this means in the context of Mellow is that, since in all deposits of the steth token the amount really transferred is being inflated, so we are to also expect an inflation in the amount of lpAmount that gets attached to this, with consequents deposits through the lifetime of the protocol, the disparity between the real amount of lp, and the value that's backing them is only going to get higher, would be key to note that even Lido has hinted that this round down could be larger in the future.
Impact
Accounting flaw in regards to the real deposited value, which not only means an inflation of the lpAmounts being processed, but also the fact that in the case of a bank run the last set of users might not be able to withdraw their assets considering with time the disparity between value deposited and lpAmount processed is only going to get accumulatively larger.
Code Snippet
https://github.com/sherlock-audit/2024-06-mellow/blob/26aa0445ec405a4ad637bddeeedec4efe1eba8d2/mellow-lrt/src/Vault.sol#L322-L338
Tool used
Manual Review
Recommendation
Since steth is supported, check the real amount of assets received when a transfer on this token is being processed.
The text was updated successfully, but these errors were encountered: