LiquidityProviders : Setting new LP token will break contract
The contract owner can change the LP token contract at any time, which would make existing LP NFTs incompatible and prevent users from withdrawing their liquidity. This could lock user funds until the owner restores the original token.
Submitted by cmichel, also found by gzeon
Owners can change the lpToken variable at any time with the setLpToken function.
If an LP token was already set and users added liquidity with addTokenLiquidity and were minted a lpToken NFT, changing the lpToken to a different contract will make it impossible for the users to withdraw their liquidity using removeLiquidity.
All users will lose their funds.
Recommended Mitigation Steps
Changing the lpToken requires a sophisticated migration mechanism.
Only allow setting the lpToken contract once.
ankurdubey521 (Biconomy) acknowledged
pauliax (judge) decreased severity to Medium and commented:
A valid concern, but I am downgrading this to Medium risk because the funds are not lost forever, the same old lpToken can be set again by the owner in such a case.
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
The owner can change the LP token contract after users have already received NFTs, without a migration mechanism.
Impact
Users could temporarily lose access to their funds, but the owner can restore the original token to fix it.
What the attacker needed
Owner changes lpToken; users have existing LP NFTs
The fix
The LP token should be set only once, or a migration mechanism should be implemented.
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.
In this system, users deposit funds and receive a special token (an NFT) that proves their deposit. The contract owner can change which token contract is used for these NFTs. If the owner changes it, the old NFTs no longer work, so users cannot get their money back until the owner switches back.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.