The `execute_limit_order` function clears the limit order in storage before calling `_remove_limit_order`, which then reads the now-empty order and uses its zero address to fetch an empty list of order IDs, causing a revert. As a result, all calls to `execute_limit_order` always revert, preventing any limit orders from being executed.
When a position is closed with bad debt, the protocol adds the bad debt to a bad_debt mapping but does not subtract it from total_debt_amount, so the same amount is counted twice. Even after the bad debt is repaid, the leftover total_debt_amount reduces available liquidity, preventing liquidity providers from withdrawing their full funds.
The `_update_debt` function updates the last debt update timestamp before calculating interest, causing the interest calculation to always return zero. As a result, no interest accrues on debt, leading to lost revenue for the protocol and liquidity providers.
The leverage calculation in a margin trading contract used the sum of debt and margin values as the numerator instead of the position value, which could lead to unfair liquidations or over-leveraged positions when the prices of the debt and position tokens diverge.
The Vault contract's set_variable_interest_parameters function updates interest rate configuration without first accruing interest since the last update. This means that when the admin changes the interest rate, the new rate is applied retroactively to the time that has already passed, rather than only to future time, which is unfair to users.
The add_path function stores the same swap path for both directions between two tokens, so when a swap uses the path in the reverse direction, the first token in the path is the output token, causing the Uniswap router to attempt to transfer the wrong token and fail. This means multihop swaps between the margin/debt token and the position token work in only one direction, potentially preventing traders from exiting positions and recovering funds.
The vault's withdrawal function calculates the number of shares to deduct using a rounding-down division, which gives the user more shares than they should have. Over time, repeated withdrawals cause the vault to lose more value than intended, eventually making it unable to repay all liquidity.
The interest calculation function divides by a base with lower precision than the numerator, amplifying the result by a factor of 1000. This inflated interest corrupts debt calculations and could break leverage, liquidation, and share mechanisms.
The Vault contract used a single 24-hour freshness threshold for all Chainlink price feeds, but some feeds update hourly, so the staleness check was ineffective for those pairs. An attacker could potentially exploit stale prices for tokens with shorter heartbeats.
The total debt shares are not updated before checking if a position is liquidable when removing margin, so a trader can remove collateral from a position that should be liquidable. This allows a trader to withdraw margin from an unhealthy position.
The reduce_position function in the Vault contract calculated its slippage protection using the whole position size instead of the amount being reduced. Because the minimum output was always larger than any achievable swap result, market-order reductions always reverted, leaving users unable to close part of their position when they wanted.
The execute_dca_order function allows any caller to supply a custom Uniswap hop path, so an attacker can insert their own token as an intermediate hop and manipulate its liquidity to give the user a poor swap rate. The user loses funds while the attacker profits from the skewed pool.
The spot DEX contracts assume that the full amount of tokens sent by a user will be received, which is incorrect for fee-on-transfer tokens. This could cause swaps to fail midway and lock funds.
The vault's share price calculation for base liquidity providers ignores bad debt when the safety module cannot cover it, so early withdrawers can take more than their fair share and later withdrawers get nothing. An attacker could withdraw their full liquidity before others, leaving remaining providers with losses.
The reduce_position function reduces a position's margin amount but fails to add the reduced amount back to the user's margin mapping, so the user cannot withdraw that margin. This causes users to lose their margin tokens.
The margin-to-debt ratio in the reduce_position function is calculated using only the debt amount, not the total position value, so when a position is reduced the margin is over-reduced and the debt is under-reduced, changing the leverage. An attacker could exploit this to alter the leverage of a position, potentially gaining more margin than intended.
The Vault contract allows an attacker to set infinite slippage on swaps during open_position, close_position, and reduce_position, enabling them to sandwich their own transaction and steal funds, leaving the position undercollateralized and creating bad debt. The protocol could be drained as a result.
UN
Unstoppable
High
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.