Skip to content
Business logic Audit finding Intermediate

Incompatibility with Rebasing/Deflationary/Inflationary tokens

The Algebra protocol does not support rebasing, deflationary, or inflationary tokens because it does not verify the actual token balance change during transfers. An attacker could exploit this to cause accounting errors or steal funds when such tokens are used.

0xDecorativePineapple Follow

Originally disclosed on Code4rena

Submitted by 0xDecorativePineapple, also found by rbserver

The Algebra protocol does not appear to support rebasing/deflationary/inflationary tokens whose balance changes during transfers or over time. The necessary checks include at least verifying the amount of tokens transferred to contracts before and after the actual transfer to infer any fees/interest.

Proof of Concept

AlgebraPool.sol#L479 AlgebraPool.sol#L548 AlgebraPool.sol#L906

Recommended Mitigation Steps

  • Make sure token vault accounts for any rebasing/inflation/deflation
  • Add support in contracts for such tokens before accepting user-supplied tokens
  • Consider to check before/after balance on the vault

sameepsi (QuickSwap & StellaSwap) acknowledged


The original report as published on Code4rena, by 0xDecorativePineapple. 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 contract does not measure the actual token balance before and after transfers, so it fails to account for tokens whose balances change during transfers or over time.

What the attacker needed

Protocol accepts rebasing/deflationary tokens

The fix

The protocol should check the token balance before and after transfers to account for any rebasing, inflation, or deflation, and only accept such tokens after adding support.

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.

Some tokens change their total supply or a user's balance automatically, for example by adding interest or taking a fee on each transfer. This report says the protocol assumes token balances stay the same, so it could miscalculate how many tokens it actually holds. That mistake might let someone take more tokens than they should.

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 0xDecorativePineapple

View all

1 more disclosed report, best first.

More from QuickSwap and StellaSwap contest

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.