Availability of deposit invariant can be bypassed
The deposit invariant that deposits are active only up to the lpETH and lpETHVault contracts being set can be bypassed. An attacker can donate ETH directly to the contract and then claim lpETH via a previously locked position or by sandwiching the convertAllETH call, gaining lpETH without locking tokens before the contracts are set.
Submitted by 0xnev, also found by Krace, 0xrex (1, 2), gumgumzum, novamanbg, Greed, y4y, DMoore, 0x04bytes, 0xBugSlayer, sldtyenj12, yovchev_yoan, 0xJoyBoy03 (1, 2), sandy, Evo, Kirkeelee, Sajjad, d3e4, samuraii77, Pechenite, TheFabled, Rhaydden (1, 2), web3er, ZanyBonzy, SBSecurity, nfmelendez, Topmark, XDZIBECX, Bigsam, shaflow2, 0xSecuri, petarP1998, bbl4de, _karanel, and btk
Impact
One of the main invariants stated in the audit is the following:
Deposits are active up to the lpETH contract and lpETHVault contract are set
However, there are currently two ways this invariant can be broken, allowing users to gain lpETH without explicitly locking tokens before contracts are set.
- Sandwich a call to
convertAllETHby front-running to directly donate ETH and then back-running to claim lpETH via multiple lock positions - Bundle a transaction of donation and claiming with a previously locked position of wrapped LRT
This bypasses the onlyBeforeDate(loopActivation) modifier included in all lock functions. It also potentially allows no cap in lpETH minted and also discourages users from locking ETH in the PrelaunchPoints.sol contract before contract addresses are set (i.e. loopActivation is assigned).
Proof of Concept
Scenario 1
Bundle a transaction of donation and claiming with a previously locked position of wrapped LRT. User can execute the following in one transaction, assuming the user previously has a locked position with any of the allowed LRTs.
- Donate ETH directly to contract.
- Call
claim()/claimAndStake(), claiming all tokens, this swaps users wrapped LRT to ETH via_fillQuote. - Since
claimedAmountis set asaddress(this).balancehere,claimedAmountis computed as the addition of ETH receive from LRT swapped + user donated ETH. claimedAmountworth of lpETH is subsequently claimed/staked vialpETH.deposit()/lpETHVault.stake().
Scenario 2
Sandwich a call to convertAllETH by front-running to directly donate ETH and then back-running to claim lpETH via multiple lock positions.
- Assume user has 10 positions of ETH/WETH locked each with 1 ether with different addresses, with 100 ETH total locked.
- Front-run call to
convertAllETHby donating 1 ETH. This setstotalLpETHto be 101 ETH as seen here. - Ratio of
totalLpETH : totalSupplycomputed here is now 1.01 (1.01). - Back-run
convertAllETHby executing claims for all 10 position, each claim will mint 0.01 ETH extra (1.01 lpETH).
This scenario is less likely than scenario 1 as it requires user to perfectly back-run convertAllETH() with claims, although it also breaks another invariant of a 1:1 swap.
Users that deposit ETH/WETH get the correct amount of lpETH on claim (1 to 1 conversion)
Recommended Mitigation Steps
- For scenario 1, set
claimedAmountto amount of ETH bought from LRT swap (such asbuyAmountfor uniV3). - For scenario 2, no fix is likely required since it would require users to risk their funds to be transferred by other users due to inflated
totalLpETH : totalSupplyratio. If not, you can consider settingtotalLpETHtototalSupplyand allow admin to retrieve any additional ETH donated.
Koolex (judge) increased severity to High
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 claimed amount is calculated from the contract's entire ETH balance rather than only the ETH obtained from swapping the user's locked tokens, so donated ETH is counted as part of the claim.
Impact
Users could gain lpETH without locking tokens before the contracts are set, potentially minting an uncapped amount and discouraging honest locking; scenario 2 is less likely as it requires perfect timing.
What the attacker needed
A previously locked position with an allowed LRT; ability to donate ETH directly to the contract; for scenario 2, ability to sandwich convertAllETH
The fix
For scenario 1, set the claimed amount to the ETH bought from the LRT swap rather than the contract balance; for scenario 2, no fix is likely required but setting totalLpETH to totalSupply and letting the admin retrieve extra ETH is suggested.
How it was found
- Have a previously locked position with an allowed LRT.
- Donate ETH directly to the contract.
- Call claim() or claimAndStake() to swap the locked LRT to ETH.
- The claimed amount includes the donated ETH, so more lpETH is minted than deserved.
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.
A smart contract has a rule that you can only deposit before certain other contracts are set up. The report shows two ways to get the reward token (lpETH) after that point anyway, by sending ETH directly to the contract and then claiming, or by timing a donation around a conversion call. This breaks the intended fairness of the deposit period.
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.