57515 sc high cross token accounting is broken

Submitted on Oct 26th 2025 at 21:25:50 UTC by @Hunterrrr for Audit Comp | Belongarrow-up-right

  • Report ID: #57515

  • Report Type: Smart Contract

  • Report severity: High

  • Target: https://github.com/immunefi-team/audit-comp-belong/blob/feat/cairo/src/receiver/receiver.cairo

Impacts:

  • Permanent freezing of funds

  • Permanent freezing of unclaimed royalties

  • Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol)

Description

Cross‑token accounting is broken

Your interface lets callers choose a payment_token for every payout:

fn releaseAll(ref self: TState, payment_token: ContractAddress);
fn release(ref self: TState, payment_token: ContractAddress, to: ContractAddress);

…but the bookkeeping accessors do not take a token parameter:

fn totalReleased(self: @TState) -> u256;
fn released(self: @TState, account: ContractAddress) -> u256;

That mismatch almost certainly means the implementation tracks released and totalReleased globally rather than per token. In any PaymentSplitter‑style contract that supports multiple ERC‑20s (as your payment_token args suggest), accounting must be token‑scoped. Otherwise, payouts in one token contaminate the math for other tokens.

For a given account, the releasable amount for a token should be:

If released(account) is tracked without the token dimension:

  • A payout in token (A) increases released(account) and will be subtracted when releasing token (B), even though they’re different assets/denominations.

  • An attacker (or even a well‑meaning third party—since release is typically permissionless) can send a worthless token to the contract and call release(worthlessToken, victim) to inflate released(victim). Later, when real tokens arrive, releasable(realToken, victim) underflows/zeros out and the victim can’t withdraw. That’s a permanent DoS on payouts for that account and token, leaving funds stuck.

This is not theoretical—mixing accounting across assets is one of the most common PaymentSplitter bugs and results in loss of funds or permanent inability to withdraw.

Proof of Concept

Was this helpful?