Skip to content

Sherlock

Unstoppable

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

disclosed reports
17
most reported class
Business logic
bug classes found
3
first disclosure
2023
Find Unstoppable on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Unstoppable chose to make public.

DoS

`MarginDex::execute_limit_order` will always revert

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.

Unstoppable

Medium
Business logic

Wrong accounting of the storage balances results for the protocol to be in debt even when the bad debt is repaid

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.

Unstoppable

High
Business logic

Vault: `_update_debt` does not accrue interest

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.

Unstoppable

High
Business logic

Leverage calculation is wrong

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.

Unstoppable

High
Business logic

The `Vault._update_debt()` function should be executed before admin sets new interest rate via `Vault.set_variable_interest_parameters()`

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.

Unstoppable

Medium
Business logic

Vault multihop swaps for any token pair will fail in one direction

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.

Unstoppable

Medium
Business logic

Debt is not updated when removing margin from a position

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.

Unstoppable

Medium
Business logic

Users trying to reduce their positions with market orders will always revert

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.

Unstoppable

Medium
Business logic

Spot dex cant handle fee-on-transfer tokens

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.

Unstoppable

Medium
Business logic

`reduce_position` doesn’t update margin mapping correctly

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.

Unstoppable

High
Business logic

`reduce_margin_by_amount` in `Vault.reduce_position` is wrongly calculated

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.

Unstoppable

High