Open code423n4 opened 1 year ago
minhquanym marked the issue as primary issue
0xRektora marked the issue as disagree with severity
Should be low severity. Strategies are easily replaceable, and scenario might never occur.
0xRektora marked the issue as sponsor confirmed
I agree with the sponsor here on severity. This setting is reversible and fixable by deploying a new strategy. No funds are at risk as far as I can tell.
dmvt changed the severity to QA (Quality Assurance)
dmvt marked the issue as grade-b
dmvt marked the issue as grade-a
Lines of code
https://github.com/Tapioca-DAO/tapioca-yieldbox-strategies-audit/blob/05ba7108a83c66dada98bc5bc75cf18004f2a49b/contracts/convex/ConvexTricryptoStrategy.sol#L179-L184
Vulnerability details
Impact
Detailed description of the impact of this finding. ConvexTricryptoStrategy will stop working after a new
lpGetter
is set by function setTricryptoLPGetter(). The main reason is that setTricryptoLPGetter() does not clear the allowance for the oldlpGetter
and does not settype(uint256).max
for the lpToken. Similar problem occurs for TricryptoNativeStrategy.setTricryptoLPGetter().Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
ConvexTricryptoStrategy.setTricryptoLPGetter() allows the owner to set a new
lpGetter
:https://github.com/Tapioca-DAO/tapioca-yieldbox-strategies-audit/blob/05ba7108a83c66dada98bc5bc75cf18004f2a49b/contracts/convex/ConvexTricryptoStrategy.sol#L179-L184
However, although it clears allowance for the old
lpGetter
and set a max allowance for the newlpGetter
for wrappedNative tokens. Such clearance and reset is not done for the lptoken. As a result, the newlpGetter
will not work for lptoken. The ConvexTricryptoStrategy contract will thus not be functioning.Tools Used
VCcode
Recommended Mitigation Steps
We need to take care of the lptoken allowance as well:
Assessed type
ERC20