Skip to content
DoS Audit finding Advanced

Indebted users can be blocked from otherwise-safe aToken transfers

When a user with outstanding debt tries to transfer aTokens, the transfer safety check calls back into the reserve token contracts and fails with a router error, which is surfaced as a transfer failure. This blocks otherwise-safe transfers even when the sender stays above the health-factor threshold, causing a functional denial of service for indebted suppliers.

FreeDropOracle Follow with binbin2803, bunnyhunter and 6 others

Originally disclosed on Code4rena

Submitted by FreeDropOracle, also found by binbin2803, bunnyhunter, codegpt, discerpo, fuzious, maxzuvex, mazennafe, and WhiteKnightK

  • contracts/a-token/src/contract.rs #L658-L664
  • contracts/kinetic-router/src/router.rs #L1840-L1879
  • contracts/kinetic-router/src/validation.rs #L256-L321
  • contracts/kinetic-router/src/calculation.rs #L200-L247
  • contracts/a-token/src/contract.rs #L70-L75
  • contracts/debt-token/src/contract.rs #L38-L4

aToken.transfer() is supposed to allow transfers as long as the sender remains above the health-factor threshold after the transfer. In the live path, that is not what happens once the sender has debt.

The issue is caused by the way aToken.transfer_internal() delegates transfer safety checks to router.validate_and_finalize_transfer(...) before balances are written. If the sender has debt, the router enters validate_user_can_withdraw(...), which recomputes user account data through calculate_user_account_data_unified(...).

That account-data path performs cross-contract balance_of_with_index calls back into the reserve token contracts. The important point is that this behaves differently depending on context:

  • as a top-level router call, the validation succeeds
  • from the live aToken transfer path, the same validation fails with KineticRouterError::TokenCallFailed

aToken.transfer_internal() then maps that failure to TokenError::TransferFailed, so the user just sees a reverted transfer.

Impact:

  • a borrower can remain above HF = 1 and still be unable to transfer even a tiny amount of aToken
  • this is a functional denial of service for indebted suppliers
  • integrations that rely on transferable receipt tokens can break for users with debt

So the practical bug is not that an unsafe transfer is allowed. It is the opposite: an otherwise-safe transfer is blocked.

Proof of Concept

See original finding for full Proof of Concept


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

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 transfer validation path performs cross-contract balance lookups that behave differently when called from the aToken transfer context than from a top-level router call, causing a spurious TokenCallFailed error.

Impact

Indebted suppliers can be blocked from transferring aTokens even when the transfer is safe, which is a functional denial of service and can break integrations that rely on transferable receipt tokens.

What the attacker needed

Sender holds aTokens; sender has outstanding debt; sender stays above health-factor threshold

How it was found

  1. Have a user with debt who holds aTokens and remains above the health-factor threshold.
  2. Attempt to transfer a small amount of aToken.
  3. The transfer path calls the router validation, which recomputes account data via cross-contract balance lookups.
  4. The validation fails with a router token-call error, which is mapped to a transfer failure and the transfer reverts.

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.

A user deposits money into a lending system and gets a receipt token (an aToken) that they can normally pass on to someone else. If that user also has an outstanding loan, the system's safety check for the transfer breaks and the transfer is rejected, even though the user is still financially safe. So the bug stops legitimate transfers rather than allowing bad ones.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More from K2

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.