Oracle will not failover as expected during liquidation
Flat Money
MediumSherlock
Every publicly disclosed report for Flat Money and what kind of bugs they were.
Newest first. Only what Flat Money chose to make public.
Flat Money
MediumThe protocol's invariant check reverts when the actual collateral balance is less than the tracked collateral balance, which can happen when a long trader's profit exceeds the LP's stable collateral total. This bricks the protocol, preventing both long traders and LPs from withdrawing their assets.
Flat Money
MediumThe trade fee for a limit order to close a leveraged position is calculated and stored when the order is announced, based on the position's size at that time. An attacker can announce a limit order with a small position size, then increase the position size before execution, so the trade fee paid is based on the smaller size, allowing them to avoid fees on the additional size at the expense of liquidity providers.
Flat Money
HighFlat Money
MediumDuring liquidation, the code passed the position's last price instead of the current price to update global position data, causing incorrect profit and loss calculation. This could inflate long traders' gains and lead to losses for liquidity providers.
Flat Money
HighFlat Money
MediumThe LeverageModule contract mints an NFT via _safeMint, which makes an external call to the receiver before updating the position state in the vault. An attacker can re-enter LimitOrder::announceLimitOrder() during that call and create a limit order with a zero trading fee because the position's additionalSize is still zero.
Flat Money
HighThe liquidation logic incorrectly accounted for profit and loss (PnL) when updating the stable collateral total and margin deposited total, leading to inflated LP collateral totals and potential loss of assets. An attacker could exploit this to withdraw more tokens than they are entitled to.
Flat Money
HighThe PnL calculation uses relative price changes, causing asymmetric outcomes when positions are adjusted. An attacker could exploit this to cause a loss of assets for the protocol or traders.
Flat Money
HighA keeper could execute an order without updating the Pyth price by passing an empty price update array, allowing them to choose an older on-chain price that benefits either LPs or traders. This could cause a loss to the opposing party.
Flat Money
HighA logic error in the funding fee settlement function can set the total deposited margin to zero when the accrued funding fees exceed the deposited margin, wiping out all long traders' collateral. Additionally, the same condition can cause an underflow revert when the sum of margin and funding fees is negative.
Flat Money
HighThe global margin accounting incorrectly deducts the total loss of all long traders from the shared margin pool, so one trader's loss can consume another trader's margin. This leaves the affected trader unable to withdraw their remaining margin and profits.
Flat Money
MediumA malicious user can perform an inflation attack on the FlatCoin vault by minting a tiny share and then inflating the assets per share, causing subsequent depositors to receive zero shares due to rounding. The attacker can then withdraw the victim's deposit.
Flat Money
MediumThe transfer lock for leveraged position orders can be bypassed by announcing a limit order and then cancelling it, which unlocks the position while a delayed close order remains active. An attacker could sell the position to a third party and then execute the close order to steal the underlying collateral.
Flat Money
HighThe check that limits how skewed the system is towards long positions was performed before updating the global position data, which changes the stable collateral total. An attacker could open a position that pushes the system beyond the allowed skew limit, making it more exposed to long-side risk.
Flat Money
MediumThe Pyth oracle integration lets a caller submit and read two different price updates within a single transaction, so two orders can settle at different prices. An attacker could open and adjust a leveraged position and close it at a favourable second price, taking profit from the other side of the trade.
Flat Money
Medium