Skip to content
Business logic Audit finding Intermediate

Incorrect token_assets_value in AccountLiquidated Event

The account_liquidate function emits an AccountLiquidated event whose token_assets_value field is filled with the liquidator's pre-liquidation token balance instead of a value for the liquidated account. Off-chain consumers such as analytics tools, dashboards and auditors would therefore read incorrect liquidation data.

Catchme Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#47380 [SC-Insight] Incorrect token_assets_value in AccountLiquidated Event

Submitted on Jun 13th 2025 at 06:49:47 UTC by @Catchme for IOP | Paradex

Description

Brief/Intro

The account_liquidate() function in the account_component.cairo file contains a flaw where the token_assets_value field in the emitted AccountLiquidated event is incorrectly set to the liquidator’s initial token balance rather than any value related to the liquidated account. This misrepresentation undermines the integrity of on-chain event data and misleads off-chain consumers such as analytics tools, dashboards, and auditors.

Vulnerability Details

In the account_liquidate() function, the protocol emits an AccountLiquidated event after transferring a share of the liquidated account’s positions and collateral. However, the token_assets_value field is populated using the liquidator's pre-liquidation balance, which is not relevant to the liquidation outcome and contradicts the field’s intended meaning.

The event documentation clearly states that token_assets_value refers to "The total value of token assets in the account" (i.e., the liquidated account). Logging the liquidator’s balance at this field is logically incorrect, misleading, and potentially harmful for off-chain systems relying on accurate data.

Rust
let initial_liquidator_token_balance = self
    .token
    .get_asset_balance_or_empty(liquidator, settlement_token_asset);

...

self.emit(
    AccountComponent::Event::AccountLiquidated(
        AccountLiquidated {
            account: account,
            liquidator: liquidator,
            token_assets_value: initial_liquidator_token_balance.amount,  // ← Incorrect source
            margin_requirement: margin_requirement.into(),
            unrealized_pnl: total_unrealized_pnl.into(),
            liquidation_penalty: liq_penalty,
            liquidation_share: liquidation_share_d.try_into().unwrap(),
            is_partial_liquidation: (!full_liquidation).into(),
            oracle_snapshot_id: oracle_snapshot_id,
        },
    ),
);

Impact Details

Off-chain systems monitoring liquidation value per account will retrieve incorrect data.

Proof of Concept

Proof of Concept

This is no need POC

The original report as published on Immunefi, by Catchme. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the event field was populated from the liquidator's pre-liquidation balance variable instead of a value derived from the liquidated account.

Impact

Off-chain systems monitoring liquidation value per account would retrieve incorrect data, which could mislead analytics and auditing tools, though no funds are lost.

What the attacker needed

A liquidation occurs on-chain

The fix

The event should be populated with the liquidated account's token asset value, matching the field's documented meaning.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When something happens on a blockchain, the program can record an event, which is like a public log entry that other software reads. Here the log entry was meant to describe the account being liquidated, but it was filled with a number belonging to the person doing the liquidating. So anyone reading that log gets the wrong picture of what happened.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Catchme

View all

16 more disclosed reports, best first.

More from Paradex

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.