The address of a new PrivatePool was derived only from a user-supplied salt, so anyone watching the public mempool could front-run a create transaction with the same salt to deploy a pool at the expected address. This let an attacker capture a user's subsequent deposit or repeatedly block pool creation.
The flash loan fee in the Private Pool contract was incorrectly set to the raw changeFee value without scaling, so a changeFee of 25 resulted in a flash loan fee of only 25 wei instead of the intended 0.0025 ETH. An attacker could borrow NFTs via flash loans for almost no fee.
The buy and sell functions in PrivatePool collected royalty fees from traders even when the royalty recipient address was zero, but did not transfer those fees to anyone. This caused traders to lose the royalty amount, which remained stuck in the pool contract.
Royalties for NFTs bought together are calculated by dividing the total sale price equally among all NFTs, ignoring each NFT's weight. This means recipients of more expensive NFTs receive less royalty than they should, while cheaper NFTs get more.
The EthRouter contract's change function sends the entire msg.value to each pool in a loop, but after the first iteration the router's balance is reduced, causing subsequent iterations to fail with an out-of-funds error. This prevents users from performing multiple changes in a single transaction.
The royalty recipient address in a collection can be a contract that rejects ether, causing the ether transfer for royalties to fail and the sell transaction to revert. An attacker could set such a recipient to block sells.
The buy and sell functions cast uint256 values to uint128 without checking for overflow, so a trade with large amounts could silently wrap the virtual reserves. This would break the constant-product pricing invariant and lead to incorrect price calculations, potentially causing financial losses.
The EthRouter contract calls setApprovalForAll on ERC721 tokens every time sell, deposit, or change is used. For tokens like Axie that revert when setting the same approval twice, this causes the router functions to revert on subsequent calls, blocking users from selling or depositing those NFTs to the same pool.
The royalty fee calculation in the buy function calls _getRoyalty twice, with an untrusted external call in between. A malicious royalty receiver could change the royalty fee between the two calls, causing the pool to pay the full sale price to the royalty receiver while the buyer pays nothing to the pool, allowing the pool to be drained.
The buy function transfers NFTs to the buyer before receiving payment, allowing the buyer to use the NFT (e.g., claim an airdrop or sell it) before paying. This enables a cheaper alternative to flash loans when the flash loan fee exceeds the combined buy and sell fees.
The changeFeeQuote function in PrivatePool calculates a fee exponent by subtracting 4 from the token's decimals. For ERC20 tokens with fewer than 4 decimals, this subtraction underflows and reverts, causing any call to change or changeFeeQuote to fail.
The flashloan function in PrivatePool sends the entire fee to the pool, while the factory receives no protocol fee, unlike other functions such as change. An attacker could take flashloans repeatedly and the protocol would lose the fee revenue it should have earned.
The PrivatePool contract charges a change fee and a flash loan fee by transferring the fee amount from the caller, even when the calculated fee is zero. If the base token is an ERC20 that reverts on zero-value transfers, the transaction fails, preventing users from using the change or flash loan features.
The previous owner of a PrivatePool could set token approvals via the execute function before selling the pool, then use flashLoan to steal the pool's tokens after ownership transfer. An attacker could drain all ERC721 and ERC20 tokens from the pool.
The protocol fee for changing NFTs was calculated as a percentage of the pool fee rather than the input amount, making it extremely low. This resulted in a loss of yield for the Caviar protocol.
The flashLoan function takes the fee from the caller (msg.sender) instead of the receiver of the callback, contrary to the EIP-3156 specification. This can cause an unexpected loss of funds for a caller who has pre-approved the pool to spend their tokens and is not the owner of the flashloan contract.
The PrivatePool contract's execute function lets the pool owner make arbitrary calls to any contract, so a malicious owner can use a user's token approvals to the pool to transfer the user's ERC20 tokens or NFTs to themselves. The report demonstrates stealing an ERC20 balance after the victim approved the pool.
A malicious royalty recipient could reenter the buy function in EthRouter.sol and steal excess ether that was refunded to the router during a user's buy order. The attacker could drain all ether held by the router before the original transaction completed.
The Pair contract's trading functions lack a deadline parameter, so pending transactions can be executed much later when market conditions have changed. An attacker could exploit this via MEV to sandwich a stale transaction, causing significant loss to the user.
The buy and sell functions transfer fractional tokens before pulling in or paying out base tokens, so an ERC777 base token can re-enter the contract mid-transfer. An attacker could repeatedly re-enter buy at stale reserves and then sell, draining value from the pair at a discount.
When adding liquidity to a two-token pool, the contract mints LP tokens using the smaller of the two proportional shares, so any imbalance between the deposited token amounts is left in the pool as a donation. A liquidity provider who deposits at a skewed ratio therefore receives fewer LP tokens than their deposit is worth and loses part of their funds on withdrawal.
The Pair contract's wrap and unwrap functions do not track which specific NFT token IDs a user deposited, so anyone can wrap one whitelisted NFT and unwrap a different whitelisted NFT without paying a fee. An attacker could also repeatedly unwrap and re-wrap every NFT held by the contract to claim airdrops meant for all liquidity providers.
The Pair contract calculates token prices from its current token balances, which an attacker can change by transferring tokens directly to the contract. This allows manipulation of the price returned by the public price function, potentially enabling theft from third-party integrations that use it as an oracle.
The price() function returns a price with the same number of decimals as the base token, not the expected 18 decimals. This causes a large mismatch between expected and actual prices when the base token has fewer than 18 decimals, such as USDC.
The pair contract mints LP shares using a formula that rounds down, so an attacker who seeds the pool with a tiny amount and then donates a large amount directly to the pair can make each share extremely valuable. Later depositors adding less than the inflated reserve then receive zero LP tokens for their deposit.
The buyQuote function in a Solidity contract rounded the required base-token payment down instead of up, so a buyer could sometimes pay zero base tokens for a small amount of fractional tokens. An attacker could repeatedly buy tiny amounts of fractional tokens for free, reducing the fractional token reserve and short-changing liquidity providers on fees.
CP
Caviar Private Pools
Medium
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.