FlashSwapRouter::emptyReserve() and FlashSwapROuter::emptyReservePartial() functions return incorrect values
Cork Protocol
HighSherlock
Every publicly disclosed report for Cork Protocol and what kind of bugs they were.
Newest first. Only what Cork Protocol chose to make public.
Cork Protocol
HighThe protocol incorrectly accounted for redemption assets (RA) when liquidating LP tokens, failing to apply the exchange rate between CT/DS and RA. This could lead to incorrect amounts of RA being reserved and withdrawn.
Cork Protocol
HighThe repurchase function incorrectly accounts for the RA fee when updating the locked RA balance, leading to an inflated locked amount. This can cause over-distribution of rewards and potentially prevent the last users from redeeming their assets.
Cork Protocol
HighThe FlashSwapRouter contract incorrectly sends the Ra tokens generated from selling reserve to the caller instead of using them to provide liquidity to the Vault. An attacker can repeatedly call swapRaforDs to drain the Vault's Ra reserves.
Cork Protocol
HighCork Protocol
MediumThe AssetFactory and FlashSwapRouter contracts inherit UUPSUpgradeable but use the notDelegated modifier on their initialize and _authorizeUpgrade functions, preventing them from being called through a proxy. As a result, the admin cannot upgrade these contracts, breaking core functionality and potentially causing stuck or lost funds.
Cork Protocol
MediumCork Protocol
MediumThe protocol's documentation claims support for rebasing tokens, but the code tracks deposit balances in state variables that do not update when token balances rebase. If a rebasing token like stETH is used, the accrued yield remains stuck in the contract and is not credited to users.
Cork Protocol
MediumThe protocol's liquidity removal and token swap functions lacked slippage protection, using zero as the minimum output amount. An attacker could front-run these transactions to manipulate prices, causing the protocol to suffer heavy slippage and lose funds.
Cork Protocol
HighThe protocol's fee distribution to Liquidity Vault (LV) token holders is not time-weighted, so a user who deposits just before fees are distributed receives the same share as a user who held tokens from the start. This allows late depositors to effectively steal fees from earlier depositors.
Cork Protocol
HighThe repurchase function transfers redemption assets into the contract without updating the internal locked balance, so the accounting understates the actual redemption assets held. After expiry, when liquidity is separated, the untracked assets remain stuck in the contract, causing a loss of funds.
Cork Protocol
HighThe redeem function in the vault pool library fails to decrease the withdrawal pool balances when a user redeems excess funds from the AMM pool, causing those funds to be double-counted in the next issuance. This allows users to withdraw more funds than they are entitled to, potentially making the vault insolvent.
Cork Protocol
HighThe reserve function records the PA amount attributed to user withdrawals in the stagnated balance field instead of the amount attributed to the AMM, and the PA attributed to the AMM is never handled afterwards. As a result, that PA becomes stuck in the vault and is never rationed again at the next expiry.
Cork Protocol
HighCork Protocol
HighThe protocol creates a Uniswap V2 pool for a new asset pair but does not add initial liquidity, leaving the pool empty. An attacker can add liquidity first at an arbitrary ratio, causing subsequent protocol deposits to use this manipulated price and enabling the attacker to profit via arbitrage.
Cork Protocol
MediumThe vault's liquidation function redeems RA using CT and DS even after the PSM has checkpointed the total CT supply, causing the vault to burn CT that was counted in the checkpoint. This leaves a portion of RA and PA permanently stuck because the checkpointed CT supply is never fully redeemed.
Cork Protocol
HighThe AssetFactory and FlashSwapRouter contracts inherit UUPSUpgradeable but set their owner to ModuleCore, which lacks the upgradeToAndCall function, so the contracts cannot be upgraded. This breaks the intended upgradeability of the protocol.
Cork Protocol
MediumThe protocol's liquidity provision function does not check the actual amounts of tokens used by the AMM, so small differences (1-2 wei) between the provided and used amounts remain locked in the contract. Over time, these discrepancies could accumulate, leading to a higher amount of locked tokens.
Cork Protocol
Medium