Skip to content

Code4rena

Superposition

Every publicly disclosed report for Superposition and what kind of bugs they were.

disclosed reports
25
most reported class
Business logic
bug classes found
5
first disclosure
2024
Find Superposition on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Superposition chose to make public.

Access control

It’s still not possible to set pool’s protocol fees

The admin cannot set a pool's protocol fee because the required function is not implemented in the SeawaterAMM contract. This means protocol fees remain unconfigurable, contrary to intended functionality.

Superposition

Medium
Business logic

No slippage control when withdrawing a position leads to loss of funds

A withdrawal function that let users set minimum amounts to receive was removed, so the only way to withdraw now offers no slippage protection. An attacker could sandwich a user's withdrawal and take a large amount of their funds.

Superposition

High
Business logic

Users are incorrectly refunded when liquidity is insufficient

The swap function takes the actual input amount from the user but then also refunds the difference between the original requested amount and the actual input, even though that difference was never taken. An attacker could repeatedly swap to drain the pool's funds through these unnecessary refunds.

Superposition

High
Business logic

Incorrect slippage handling in swap_internal()

The swap slippage check in swap_internal() used a logical OR, so a swap was accepted when only one of the two output amounts was above zero. An attacker or unlucky user could complete a swap that returns nothing of the token they wanted while still passing validation.

Superposition

Medium
Smart contracts

_onTransferReceived() does not work as intended

The contract's transfer callback check uses an inverted comparison, so it reverts when a compliant receiver returns the expected selector and accepts when the selector is wrong. This prevents safe transfers to contracts that correctly implement the ERC-721 receiver interface.

Superposition

Medium
Business logic

bytes data param is not passed to ERC721 recipient as expected by EIP-721

The ERC-721 safeTransferFrom function that accepts a bytes data parameter does not forward that data to the recipient contract's onERC721Received callback, instead passing empty bytes. This can cause transfers to revert for recipient contracts that expect to decode the data, making the function unusable for them.

Superposition

Medium
Smart contracts

Unintended under/overflow of the amount already swapped in/out due to unmatching logic

The swap calculation in a Rust implementation of a Uniswap-like pool uses unchecked subtraction and addition for the amount already swapped, which can underflow or overflow in release mode. An attacker could potentially cause incorrect swap amounts, though the report does not demonstrate a practical exploit.

Superposition

Medium
Business logic

Users can’t remove liquidity while a pool is disabled

A pool-disabling feature blocks all liquidity changes, including withdrawals, because a single check rejects any call when the pool is disabled. Users cannot remove their funds during an emergency, leaving their money at risk.

Superposition

Medium
Race condition

Lp’s liquidity may be lost if re-org happens

A liquidity provider can remove liquidity and then burn their position, but if a blockchain re-org occurs, an attacker can manipulate the pool price so the removal reverts while the burn succeeds, locking the funds. The report claims this could cause loss of the LP's liquidity.

Superposition

Medium
Business logic

Parameter misordering in fee collection function causes denial of service and fee loss

The fee collection function passed the recipient address as the token address and the pool address as the recipient when calling the token transfer helper, so every attempt to collect protocol fees reverted. As a result, the admin could not withdraw accumulated fees, locking them in the pools.

Superposition

High
Business logic

Missing lower<upper check in mint_position

The mint_position function does not check that the lower tick is less than the upper tick, allowing positions with equal or inverted ticks. An attacker can create positions with arbitrary liquidity without paying tokens or manipulate fee calculations to steal fees from other liquidity providers.

Superposition

High
Access control

Unrevoked approvals allow NFT recovery by previous owner

The smart contract does not clear token approvals when an NFT is transferred, so a previously approved address can still transfer the NFT away from its new owner. This allows the previous owner or an approved address to reclaim the NFT after a sale or transfer.

Superposition

High
Smart contracts

decrPosition09293696 will not work due to incorrect function signature

The Solidity wrapper function decrPosition09293696 is missing the pool address parameter that the underlying Rust function requires, so any call to it will fail. This makes the decrease position functionality inaccessible through the wrapper.

Superposition

Medium
Business logic

No related function to set fee_protocol

The pool contract defines a protocol fee rate but provides no function to set it, so the protocol can never accumulate fees. An attacker cannot exploit this; it is a missing feature that prevents the protocol from earning revenue.

Superposition

Medium
Business logic

If liquidity is insufficient, users may need to pay more tokens in swap2

In the swap_2_internal function, if the first pool has insufficient liquidity, the calculated amount_in may be less than the original amount, but the contract still takes the full original amount from the user, causing overpayment. An attacker could exploit this to make users pay more tokens than necessary.

Superposition

Medium
Business logic

Wrong liquidity formula used

The protocol's liquidity calculation used the price at the current tick instead of the actual current square-root price, causing incorrect liquidity deltas. This could make transactions revert when minimum amounts are close to desired amounts, and the judge noted it could make a portion of the protocol inaccessible.

Superposition

Medium