Some curve pools can not be used as a single sided strategy
The Curve2TokenPoolMixin contract assumes it can always retrieve the LP token from the pool, but some Curve pools do not expose the LP token publicly, so those pools cannot be used for single-sided strategies. An attacker could not exploit this; it is a functional limitation that prevents integration with certain pools.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2023-10-notional-judging/issues/40
Found by
mstpr-brainbot
Summary
For single sided curve strategy contest docs says that any curve pool should be ok to be used. However, some pools are not adaptable to the Curve2TokenPoolMixin abstract contract.
Vulnerability Detail
The contract assumes the existence of three types of pool scenarios. In one scenario, the pool address itself serves as the LP token. In another scenario, the LP token is obtained by querying the lp_token() or token() function. However, in some cases where potential integration with Notional is possible, certain pools lack a direct method to retrieve the underlying LP token. For instance, the sETH-ETH pool, which presents a promising option for a single-sided strategy in ETH vaults, does not offer public variables to access the underlying LP token. Although the pool contract contains the token variable that returns the LP token of the pool, this variable is not publicly accessible. Consequently, in such cases, querying the LP token directly from the pool is not feasible, and it becomes necessary to provide the LP token address as input.
Here the example contracts where neither of the options are available: sETH-ETH: https://etherscan.io/address/0xc5424b857f758e906013f3555dad202e4bdb4567 hBTC-WBTC: https://etherscan.io/address/0x4ca9b3063ec5866a4b82e437059d2c43d1be596f
Impact
All curve pools that can be used as a single sided strategy for notional leveraged vaults considered to be used but some pools are not adaptable thus I will label this as medium.
Code Snippet
Tool used
Manual Review
Recommendation
Curve contracts are pretty different and it is very hard to make a generic template for it. I would suggest make the LP token also an input and remove the necessary code for setting it in the constructor. Since the owner is trusted this should not be a problem.
Discussion
jeffywu
Valid suggestion.
jeffywu
https://github.com/notional-finance/leveraged-vaults/pull/70
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the contract assumes all Curve pools expose the LP token address via a public variable or function, but some pools keep it private.
Impact
Some Curve pools cannot be used for single-sided strategies, limiting the available pools for Notional leveraged vaults.
What the attacker needed
None
The fix
The LP token address should be provided as an input parameter instead of being fetched from the pool.
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.
This is about a smart contract that helps users put money into Curve pools. The contract tries to find a special token (the LP token) that represents their share, but some pools hide that token, so the contract fails. It is not a security bug that lets someone steal funds; it just means those pools cannot be used.
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.