Lenders lose interests and pay deposit fees due to no slippage control
The addQuoteToken function lacks slippage protection, so a lender's deposit may be processed after the LUP has moved, causing them to be charged a deposit fee and earn no interest. An attacker could front-run to manipulate the LUP and force the victim to pay fees.
When a lender deposits quote tokens below the minimum of LUP(Lowest Utilization Price) and HTP(Highest Threshold Price), the deposits will not earn interest and will also be charged deposit fees, according to docs. When a lender deposits to a bucket, they are vulnerable to pool LUP slippage which might cause them to lose funds due to fee charges against their will.
Vulnerability Detail
A lender would call addQuoteToken() to deposit. This function only allows entering expiration time for transaction settlement, but there is no slippage protection.
In LenderActions.sol, addQuoteToken() takes current DepositsState in storage and current poolState_.debt in storage to calculate spot LUP prior to deposit. And this LUP is compared with user input bucket index_ to determine if the lender will be punished with deposit fees. The deposit amount is then written to storage.
It should be noted that current deposits_ and poolState_.debt can be different from when the user invoked the transaction, which will result in a different LUP spot price unforeseen by the lender to determine deposit fees. Even though lenders can input a reasonable expiration time expirty_, this will only prevent stale transactions to be executed and not offer any slippage control.
When there are many lenders depositing around the same time, LUP spot price can be increased and if the user transaction settles after a whale lender which moves the LUP spot price up significantly, the user might get accidentally punished for depositing below LUP. Or there could also be malicious lenders trying to ensure their transactions settle at a favorable LUP/HTP and front-run the user transaction, in which case the user transaction might still settle after the malicious lender and potentially get charged for fees.
Impact
Lenders might get charged deposit fees due to slippage against their will with or without MEV attacks, lenders might also lose on interest by depositing below HTP.
Add slippage protection in Pool.sol addQuoteToken(). A lender can enable slippage protection, which will enable comparing deposit index_ with lupIndex in LenderActions.sol.
Discussion
ith-harvey
We think this should be a low. Although not explicitly stated that this can happen in docs it is assumed based off of implementation. We were aware, not concerned.
We think this should be a low. Although not explicitly stated that this can happen in docs it is assumed based off of implementation. We were aware, not concerned.
this is more like a feature request, not bug
sherlock-admin
Escalate for 10 USDC.
As the sponsor said
We think this should be a low. Although not explicitly stated that this can happen in docs it is assumed based off of implementation. We were aware, not concerned.
this is more like a feature request, not bug
You've created a valid escalation for 10 USDC!
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.
bzpassersby
I think this issue is a valid medium. It points to a possible scenario where a lender has to pay fees and lose interest against their will due to no slippage protection, which can be exploited through MEV attack. Because of the scenario of lenders losing funds against their intention, it should be medium.
Due to the fact that slippage can be exploited to cause users to lose funds, this should be considered a vulnerability or bug.
0xffff11
I disagree with the escalation in this case. I think it should be a medium. Despite being a design decision, allows users to be exposed to high slippage on behalf of their decision.
dmitriia
Looks like valid medium to me, the probability of the material impact can be said to be medium, so is the impact itself.
The original report as published on Sherlock, by branch_indigo. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Generating the AI write-up for this report.
This usually takes about a minute. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
How it worked
Root cause
The addQuoteToken function does not allow the lender to specify a maximum acceptable slippage or a minimum LUP, so the deposit fee is determined by the pool state at execution time, which can be manipulated.
Impact
Lenders may be charged deposit fees and lose interest due to slippage, with or without MEV attacks.
What the attacker needed
Lender interacts with the pool; pool state changes before transaction executes
The fix
The fix adds a slippage protection flag to addQuoteToken and moveQuoteToken, allowing lenders to revert if the deposit would be below the LUP.
How it was found
A lender calls addQuoteToken to deposit quote tokens into a bucket.
The function calculates the current LUP based on the pool's debt and deposits at the time of execution.
If the deposit's bucket index is above the LUP index, a deposit fee is charged.
Because the LUP can change between the lender's transaction submission and execution, the lender may be charged a fee unexpectedly.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Generating the AI write-up for this report.
This usually takes about a minute. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
When you deposit money into a lending pool, the pool checks if your deposit is below a certain price threshold. If it is, you get charged a fee and earn no interest. This report says the check happens at the time your transaction is processed, not when you send it, so someone else's transaction can change the threshold and make you pay the fee unexpectedly.
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.