-
Notifications
You must be signed in to change notification settings - Fork 10
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
Curve Strategy Yield can be Lost by Griefing due to Delta Balance Check #1429
Comments
minhquanym marked the issue as primary issue |
Similar #269 |
cryptotechmaker (sponsor) confirmed |
dmvt changed the severity to QA (Quality Assurance) |
dmvt marked the issue as grade-b |
The finding states:
|
This previously downgraded issue has been upgraded by dmvt |
Agreed. I don't remember exactly why I downgraded this one in the first place. May have been a mistaken button press on my part. Thanks for raising it. |
dmvt marked the issue as selected for report |
Note I'm leaving this as a unique because of the third point
|
Lines of code
https://github.com/Tapioca-DAO/tapioca-yieldbox-strategies-audit/blob/05ba7108a83c66dada98bc5bc75cf18004f2a49b/contracts/curve/TricryptoNativeStrategy.sol#L151-L156
Vulnerability details
Impact
TricryptoLPStrategy-compound
computes the amount ofCRV
to Sell as:uint256 crvAmount = crvBalanceAfter - crvBalanceBefore;
https://github.com/Tapioca-DAO/tapioca-yieldbox-strategies-audit/blob/05ba7108a83c66dada98bc5bc75cf18004f2a49b/contracts/curve/TricryptoNativeStrategy.sol#L151-L156
This assumes that
minter.mint(address(lpGauge));
will cause tokens to be sent to the StrategyHowever, a griefer could call
claim_rewards(STRATEGY):
to cause theCRV
to be sent directly to it before a call tocompound
is made.This breaks the check (since it will result in a 0)
And causes total Loss of Yield
POC
claim_rewards(STRATEGY)
Code from Curve Gauge
https://arbiscan.io/address/0x555766f3da968ecbefa690ffd49a2ac02f47aa5f#code#L544
As you can see the gauge allows claiming on behalf, which will break the delta check from the Strategy
Mitigation
Use the absolute value for Curve or similar reward tokens, also consider adding a sweep function while protecting the deposit tokens
Assessed type
ERC4626
The text was updated successfully, but these errors were encountered: