Skip to content

Code4rena

Particle Leverage AMM Protocol Invitational

Every publicly disclosed report for Particle Leverage AMM Protocol Invitational and what kind of bugs they were.

disclosed reports
29
most reported class
Business logic
bug classes found
4
first disclosure
2023
Find Particle Leverage AMM Protocol Invitational on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Particle Leverage AMM Protocol Invitational chose to make public.

Business logic

Liquidation condition should not factor the liquidation reward into the premiums

The liquidation condition in Particle LAMM subtracts the liquidation reward from the premiums before checking whether the premiums are sufficient to cover the owed tokens. This can cause a lien to be considered underwater and liquidated even when it would otherwise be healthy.

Particle Leverage AMM Protocol Invitational

Medium
Access control

Position can be opened even when the particle position manger does not hold the Uniswap V3 Position NFT

The Particle position manager allowed opening a position without actually holding the Uniswap V3 NFT, as long as the NFT owner had approved the manager as an operator. An attacker could then open a position on behalf of the original owner, reduce the original liquidity, and maintain sufficient premium to avoid liquidation.

Particle Leverage AMM Protocol Invitational

Medium
Business logic

Malicious lender can manipulate the fee to force borrower pay high premium

The fee used to calculate the premium owed by a borrower is read from the Uniswap v3 position manager at the time the position is closed, so a malicious lender can inflate that fee by adding liquidity and swapping back and forth, forcing the borrower to pay a higher premium. The lender can recover most of the swap fees if they dominate the liquidity in the tick range.

Particle Leverage AMM Protocol Invitational

Medium
Business logic

AddLiquidity and decreaseLiquidity missing slippage protection

The contract hardcodes the minimum amount parameters to zero when increasing or decreasing liquidity in Uniswap V3 positions, removing slippage protection. An attacker could front-run these transactions to cause the user to receive much less than expected.

Particle Leverage AMM Protocol Invitational

Medium
DoS

If the borrower enters token blacklist, LP may never be able to retrieve Liquidity

The contract refunds surplus tokens to the borrower during position closure, but if the borrower is blacklisted by the token (e.g., USDC), the transfer reverts, blocking closure and locking LP liquidity. An attacker could exploit this to prevent liquidation and cause bad debt for LPs.

Particle Leverage AMM Protocol Invitational

High
Business logic

openPosition() use stale feeGrowthInside0LastX128/feeGrowthInside1LastX128

The openPosition function stored fee growth values from the Uniswap position manager that were not up to date, because they only update when liquidity is increased, decreased, or collected. This caused borrowers to pay extra fees when closing their positions.

Particle Leverage AMM Protocol Invitational

High
Business logic

Dangerous use of deadline parameter

The protocol passed the current block timestamp as the deadline when calling Uniswap's position manager, so the deadline check always passed. An attacker could hold a pending transaction and execute it later, potentially causing the user to suffer unfavourable price movements.

Particle Leverage AMM Protocol Invitational

Medium
Business logic

Modifying the loan term setting can default existing loans

The protocol's liquidation check uses the current global loan term setting rather than the term agreed when a position was created. If an admin reduces the loan term, existing positions can be liquidated earlier than their original terms allowed.

Particle Leverage AMM Protocol Invitational

Medium
Business logic

liquidatePosition() liquidator can construct malicious data to steal the borrower’s profit

The liquidatePosition() function allows the liquidator to supply arbitrary swap data, which can be manipulated to steal the borrower's profit. By constructing malicious data and using a fake token with a callback, the liquidator can repay less than the collateral value and keep the difference.

Particle Leverage AMM Protocol Invitational

High
DoS

Zero amount token transfers may cause a denial of service during liquidations

Some ERC20 tokens revert on zero-value transfers, and the liquidation reward calculation can produce zero, causing the liquidation transfer to revert and blocking liquidations. An attacker could open a position with such a token to prevent its liquidation.

Particle Leverage AMM Protocol Invitational

Medium
Business logic

openPosition() Lack of minimum token0PremiumPortion/token1PremiumPortion limit

The openPosition function allowed both premium portions to be zero, so when a position was out of price, an attacker could borrow liquidity without paying any fees. This could lead to malicious occupation of liquidity and prevent liquidators from acting because there was no profit.

Particle Leverage AMM Protocol Invitational

Medium
Business logic

Impossible to open a position with a large marginTo

The openPosition function in ParticlePositionManager underflows when a user supplies a marginTo larger than collateralTo minus amountToBorrowed, causing the transaction to revert. This prevents users from providing a larger margin to increase their premium.

Particle Leverage AMM Protocol Invitational

Medium
Business logic

Add premium doesn’t collect fees

The protocol charges a fee on the margin provided when opening a position, but not when adding margin later via addPremium. A borrower can avoid part of the fee by opening a position with minimal margin and then adding the rest via addPremium.

Particle Leverage AMM Protocol Invitational

Medium
DoS

addCredit() DOS Attack

Anyone can call addCredit() with a tiny amount of ether, which changes the stored hash of a lien. By front-running, an attacker can cause validateLien() checks to fail, blocking legitimate actions such as bidding, starting or stopping auctions, and repaying with an NFT.

Particle Leverage AMM Protocol Invitational

Medium
Business logic

withdrawNftWithInterest() possible take away other Lien’s NFT

The withdrawNftWithInterest function allowed a lender to withdraw an NFT even when another lien on the same NFT was active, because it only checked that the caller was the lender and did not verify that the lien had no active loan. An attacker could take away another lien's NFT, causing loss of the NFT and funds.

Particle Leverage AMM Protocol Invitational

High
Business logic

New treasury rate should not affect existing loan

The contract owner can change the treasury fee rate at any time, and the new rate applies to existing loans. This means a lender who agreed to a 5% fee could suddenly face a 50% fee when claiming interest, reducing their payout.

Particle Leverage AMM Protocol Invitational

Medium
Race condition

_execSellNftToMarket() re-enter steal funds

The contract's sell function checks payment by comparing balance changes, but lacks reentrancy protection. An attacker can reenter the function during an NFT transfer to make multiple sales while only paying once, stealing funds from the contract.

Particle Leverage AMM Protocol Invitational

High
Business logic

Treasury fee is not collected in withdrawEthWithInterest()

The withdrawEthWithInterest function transfers the full interest amount to the lender without deducting the treasury fee, so the protocol loses the fee it should have collected. An attacker (or any lender) could repeatedly withdraw interest and deprive the treasury of its share.

Particle Leverage AMM Protocol Invitational

High
Business logic

_execBuyNftFromMarket() Need to determine if NFT can’t already be in the contract

The contract's buy function checked that the NFT was owned by the contract after the purchase, but did not check that it was not already owned before. An attacker could supply an NFT that was already in the contract as collateral for a second lien, then call the buy function with trade data for a different NFT, causing the contract to buy that other NFT while the check still passed.

Particle Leverage AMM Protocol Invitational

High