Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Glossary

Rebasing Token Exploit

A rebasing token exploit is a DeFi attack vector that manipulates the elastic supply mechanics of rebasing tokens within Automated Market Makers (AMMs) to extract a disproportionate share of pooled assets.
Chainscore © 2026
definition
SECURITY VULNERABILITY

What is a Rebasing Token Exploit?

An attack vector targeting the unique mechanics of rebasing tokens to drain value from unsuspecting users or protocols.

A rebasing token exploit is a security vulnerability that manipulates the elastic supply mechanism of a rebasing token—a token whose circulating supply automatically adjusts to maintain a target price peg—to steal funds. Unlike standard ERC-20 tokens, a rebasing token's balance in a user's wallet changes periodically based on a rebase function, which proportionally increases or decreases all holders' balances. Exploits typically occur when a protocol's smart contract logic fails to account for these balance changes between transactions, creating arbitrage opportunities or allowing an attacker to withdraw more assets than they deposited.

The core vulnerability often lies in the delta between a recorded historical balance and the actual balance after a rebase. A common attack pattern, such as the donation attack, involves an attacker artificially inflating the token's total supply by sending a large amount to a vulnerable lending or staking contract. This triggers a positive rebase for all holders within that contract. The attacker then immediately withdraws their collateral, but due to flawed accounting, receives a share of the newly rebased tokens belonging to other users, effectively draining the pool. Protocols must use balanceOf at the exact moment of calculation, not cached values, to mitigate this.

These exploits highlight a critical composability risk in DeFi, where standard token assumptions break down. Developers interacting with rebasing tokens like Ampleforth (AMPL) or Olympus DAO's (OHM) must implement rebase-aware accounting. This involves using the balanceOf function in every state-changing transaction and avoiding the storage of balance snapshots. Auditing for rebasing token vulnerabilities requires checking all price oracles, collateral calculations, and reward distribution logic for proper handling of the elastic supply property, ensuring the protocol's internal math aligns with the token's real-time, fluctuating balances.

how-it-works
SECURITY MECHANISM

How a Rebasing Token Exploit Works

A rebasing token exploit is a class of smart contract attack that manipulates the automatic supply adjustment mechanism of a token to drain value from liquidity pools or other contracts.

A rebasing token exploit is a financial attack that targets the unique supply elasticity of tokens like Ampleforth (AMPL). These tokens periodically adjust every holder's balance based on a target price, a process called a rebase. The exploit occurs when an attacker manipulates the token's total supply or price oracle just before a scheduled rebase event. By artificially inflating or deflating the supply metric, the attacker can cause the rebase algorithm to incorrectly calculate and distribute new tokens, siphoning value from other holders or from integrated DeFi protocols like lending markets and automated market makers (AMMs).

The most common attack vector involves a flash loan. An attacker borrows a massive amount of capital, uses it to manipulate the rebasing token's price on a decentralized exchange (DEX), and triggers a rebase that mints them a disproportionate share of new tokens. After the rebase, they sell the newly minted tokens, repay the flash loan, and pocket the difference. This exploits the fact that many DeFi integrations do not account for the balance volatility inherent to rebasing tokens within a single transaction, treating the pre- and post-rebase balances as separate states that can be arbitraged.

Another critical vulnerability is donation attacks. Here, an attacker donates a large number of rebasing tokens to a vulnerable contract, such as a liquidity pool or a lending market vault. This drastically increases the contract's share of the total token supply. During the next rebase, the contract receives a massive inflation of tokens. The attacker then exploits another function—like a skewed exchangeRate calculation in a lending protocol—to withdraw far more underlying assets than they deposited, draining the contract's reserves. This attack highlights the danger of integrating rebasing tokens without isolating their balance-changing logic.

Preventing these exploits requires careful smart contract design. Protocols must use snapshotting mechanisms to record balances before any state-changing operation and use those snapshots consistently. Furthermore, oracle manipulation must be guarded against by using time-weighted average prices (TWAPs) or other robust price feeds. Developers should treat rebasing tokens as having a dynamic balanceOf and design systems that are stateful across the rebase event, ensuring accounting logic cannot be gamed within a single block or transaction.

Historical examples include the 2021 exploit of the Visor Finance liquidity management protocol, where an attacker used a donation attack against a vault holding the stETH rebasing token. The attack netted over $8 million, demonstrating the severe financial impact. These incidents serve as critical case studies, emphasizing that while rebasing is a novel monetary policy, its interaction with DeFi's composable lego blocks requires exceptional diligence to avoid creating unintended and exploitable economic incentives.

key-mechanics
REBASING TOKEN EXPLOIT

Key Attack Mechanics & Prerequisites

A rebasing token exploit is a vulnerability that arises from the interaction between a token's automatic supply adjustment mechanism and external smart contracts that fail to account for these changes. Attackers exploit the resulting accounting discrepancies to drain value.

01

The Core Mechanism: Supply Rebasement

Rebasing tokens (e.g., Ampleforth) automatically adjust the token balance in every holder's wallet at set intervals to target a specific price. This is done by changing the total supply, not the price per token. Your wallet balance increases or decreases, but your percentage ownership of the total supply remains constant. This creates a discrepancy between a token's raw balanceOf() and its effective value.

02

Prerequisite: Incompatible External Contracts

The exploit requires a vulnerable third-party contract that interacts with the rebasing token but does not update its internal accounting after a rebase. Common targets include:

  • Lending protocols using the token as collateral.
  • Automated Market Makers (AMMs) with liquidity pools.
  • Yield farming vaults or staking contracts. These contracts often store a stale balance or exchange rate, creating an arbitrage opportunity.
03

Attack Vector: Balance/Supply Mismatch

The attacker exploits the difference between the actual token balance and the recorded balance in the vulnerable contract. After a positive rebase increases balances, the vulnerable contract may still honor withdrawals based on the pre-rebase, lower balance recorded in its state. The attacker can then withdraw more tokens than the contract believes they have, or use overvalued collateral to borrow other assets.

04

Example: Lending Protocol Drain

A classic scenario:

  1. User deposits 100 rebasing tokens as collateral into a lending protocol.
  2. A positive rebase occurs, increasing the user's actual balance to 110 tokens.
  3. The lending protocol's internal ledger still shows 100 tokens.
  4. The protocol's getCollateralValue() function uses the stale 100-token balance.
  5. The attacker borrows other assets against this undervalued collateral.
  6. The attacker repays the loan and withdraws the 110 tokens, profiting from the 10 'invisible' tokens.
05

Mitigation: Using 'Shares' or Snapshots

Secure integration requires moving away from direct balance tracking. Standard mitigations include:

  • Share-based accounting: Instead of tracking token amounts, contracts issue shares representing a claim on the pool's total tokens. Balances are calculated as (userShares / totalShares) * poolTokenBalance.
  • Rebase-aware oracles: Using price oracles that account for the rebasing mechanism to value collateral correctly.
  • Explicit snapshots: Recording balances at the block level before and after interactions.
06

Related Vulnerability: Donation Attacks

This is a related exploit targeting rebasing tokens in liquidity pools. An attacker donates a large amount of tokens to the pool, artificially inflating the balanceOf(pool) without a corresponding increase in the other reserve asset. This drastically skews the pool's price, allowing the attacker to exploit other users' transactions or drain value via manipulated swap rates. It highlights the danger of AMM math with supply-changing assets.

real-world-examples
REBASING TOKEN EXPLOIT

Real-World Protocol Examples & Incidents

Rebasing token exploits leverage the unique, automatic supply-adjustment mechanics of elastic tokens to manipulate balances and drain liquidity pools. These incidents highlight critical vulnerabilities in how protocols integrate these non-standard assets.

02

The Visor Finance (VISR) Liquidity Pool Drain

In December 2021, Visor Finance's Hypervisor liquidity management contracts were exploited for ~$8.8 million. The attack vector was a misalignment between token accounting and rebasing logic. The exploiter:

  • Deposited Stake DAO's sdETH (a rebasing staked Ether derivative) into a Visor vault.
  • The vault's internal accounting did not immediately reflect the sdETH rebasing rewards, creating a lag between the actual and recorded balance.
  • The attacker repeatedly deposited and withdrew, claiming the "unaccounted for" rebasing rewards each cycle, effectively draining the underlying liquidity pool.
03

Core Vulnerability: Balance vs. Total Supply Mismatch

The fundamental flaw in most rebasing exploits is the discrepancy between an account's balanceOf and its proportional share of the totalSupply. In standard ERC-20 tokens, these are directly correlated. In rebasing tokens, a user's balance changes automatically, but many DeFi protocols cache or calculate value based on a static snapshot. Exploiters manipulate this by:

  • Triggering a rebase after a protocol has recorded a balance but before it settles a transaction.
  • Exploiting rounding errors or fee-on-transfer mechanics in pools not designed for elastic supply.
  • Using donations to artificially inflate the total supply and skew share calculations.
04

The Fei Protocol Rari Fuse Pool Incident

In April 2022, Fei Protocol's Tribe (TRIBE) token, which employed a reward distribution mechanism similar to rebasing, was involved in an exploit on Rari Capital's Fuse pools. While not a classic rebase, it shared the critical flaw: balance changes external to transfers. An attacker manipulated a Fuse pool's internal accounting by:

  • Borrowing assets against TRIBE collateral.
  • Claiming TRIBE staking rewards, which increased the collateral balance outside the lending protocol's ledger.
  • Using the unaccounted increase in collateral value to borrow more assets, ultimately draining the pool of ~$80M. This highlights the risk of any token with non-transfer balance updates.
05

Mitigation & Best Practices for Protocols

Protocols integrating rebasing or similar tokens must implement specific safeguards:

  • Use the balanceOfUnderlying pattern: Query the rebasing contract for the real-time, post-rebase balance at every critical state change (e.g., before a withdrawal or liquidation).
  • Employ snapshotting mechanisms: Record a user's share of the totalSupply at deposit, rather than a static token amount.
  • Isolate in separate adapters: Treat rebasing tokens as a distinct asset class with custom logic, preventing them from interacting with standard AMM math.
  • Conduct rigorous integration audits: Specifically test for supply change scenarios, donation attacks, and rounding issues.
06

Related Concept: Elastic vs. Rebase Tokens

Understanding the taxonomy is key to identifying risk:

  • Rebasing Tokens (e.g., Ampleforth, OHM): Adjust every holder's balance proportionally based on a target price or metric. The totalSupply changes.
  • Elastic Supply Tokens (e.g., Empty Set Dollar): May use seigniorage or bonding curves to adjust supply, often burning or minting to/from a treasury rather than all wallets.
  • Staking Derivative Tokens (e.g., stETH, sdETH): Accrue rewards via a growing balance, mimicking a rebase but often through a different mechanism (share-based system). All three can cause the same accounting mismatch if a protocol assumes a user's token balance only changes via direct transfers.
security-considerations
REBASING TOKEN EXPLOIT

Security Considerations & Risks

A rebasing token exploit is a vulnerability where an attacker manipulates the token's elastic supply mechanism to drain value from a protocol. These attacks exploit the discrepancy between a token's rebasing balance and its representation in external contracts.

01

Core Vulnerability: Balance Discrepancy

The fundamental flaw exploited is the balance accounting mismatch between the rebasing token contract and an external protocol. When a rebasing token's supply changes (e.g., AMPL, OHM), the balances in user wallets adjust automatically. However, many DeFi protocols cache or store a user's balance at deposit time. An attacker can:

  • Deposit tokens before a positive rebase (inflation).
  • Withdraw after the rebase, claiming the newly minted tokens from the protocol's reserves.
  • Repeat to drain the contract's underlying assets, as the protocol's internal accounting does not reflect the updated, higher balances.
02

The "Donation" Attack Vector

A common method is the donation attack. The attacker donates a large amount of rebasing tokens to the vulnerable contract, artificially inflating the total supply recorded by the protocol. This drastically reduces the share value for all other depositors. The attacker then withdraws, receiving a disproportionately large share of the underlying collateral because the protocol calculates withdrawals based on the manipulated share price. This was famously demonstrated in the 2021 Warren Buffet (WARREN) token exploit on the SushiSwap BentoBox.

03

Protocol Integration Risks

Standard ERC-20 integration patterns fail with rebasing tokens. Key risks for developers include:

  • Using balanceOf for accounting: Storing a user's balanceOf at deposit is unsafe, as it changes post-rebase.
  • Incorrect share calculations: Protocols must track internal shares that are independent of the rebasing balance.
  • Oracle manipulation: Price oracles that use the token's total supply can be gamed during a rebase event.
  • Lack of balanceOf hooks: Unlike ERC-777, standard ERC-20 tokens do not notify contracts of balance changes, leaving them "out of sync."
04

Mitigation Strategies

Secure integration requires specific design patterns:

  • Use internal shares: Record user deposits as a share of the contract's total holdings, not a token amount. Update shares only on user actions (deposit/withdraw).
  • Checkpointed balances: Implement a system that snapshots balances at each user transaction, ignoring rebases between interactions.
  • Whitelist known tokens: Protocols can explicitly support only well-understood rebasing tokens with audited adapters.
  • Isolated collateral types: In lending markets, keep rebasing tokens in separate, isolated pools to prevent contamination of other assets.
  • Adopt ERC-777 or similar: Use token standards with transaction hooks for balance change notifications.
05

Historical Example: SushiSwap BentoBox

In October 2021, an attacker exploited the BentoBox vault's integration with the rebasing WARREN token.

  • The attacker donated a massive amount of WARREN to BentoBox, crashing the internal share price.
  • They then withdrew their original deposit, but due to the manipulated math, received nearly all of the vault's WETH collateral.
  • Result: The attacker netted ~$10M in WETH for a minimal cost, draining the vault. This incident became the canonical case study for rebasing token vulnerabilities in liquidity vaults.
06

Audit & Testing Focus

Security reviews for protocols that may handle rebasing tokens must include:

  • Balance invariance testing: Verify that a rebase event cannot change the protocol's total underlying asset value.
  • Donation attack simulations: Stress-test the contract with extreme token donations and rebases.
  • Integration code review: Scrutinize any use of balanceOf or totalSupply for accounting logic.
  • Fork testing: Test integrations on a forked mainnet during actual historical rebase events of tokens like AMPL or OHM to observe real-world behavior.
REBASING TOKEN EXPLOIT

Mitigation Strategies: Comparison

A comparison of common strategies to mitigate the risk of rebasing token exploits in DeFi smart contracts.

Mitigation FeatureSnapshot BalancesDelayed Rebase AccountingWhitelist Rebase Tokens

Core Mechanism

Store user balance at interaction

Process rebase effects after a delay

Restrict to approved token list

Prevents Donation Attack

Prevents Inflation Attack

Gas Overhead

Medium (storage writes)

Low (timestamp checks)

Low (mapping lookup)

Implementation Complexity

Medium

High

Low

User Experience Impact

Transparent to user

Delayed balance updates

Restricts token composability

Example Pattern

Checkpointed balances (e.g., veTokens)

Epoch-based accounting

Curated asset registry

developer-perspective
MECHANICAL FAILURE

Developer Perspective: The Core Vulnerability

An examination of the fundamental protocol-level flaw that enables rebasing token exploits, focusing on the mechanics of balance manipulation rather than social engineering.

A rebasing token exploit is a smart contract attack that manipulates a token's elastic supply mechanism to drain liquidity or mint unauthorized tokens by exploiting the discrepancy between a user's balanceOf and the underlying shares that represent ownership. Unlike standard ERC-20 tokens where balance is a simple state variable, rebasing tokens (e.g., Ampleforth, Olympus DAO's OHM) adjust all holders' balances proportionally based on a rebase function, which changes the exchange rate between shares and the displayed balance. The core vulnerability arises when a protocol incorrectly assumes the balanceOf return value is stable within a single transaction, allowing an attacker to perform a donation attack or balance inflation.

The canonical attack vector involves an inflation attack. An attacker first donates a massive amount of tokens to a vulnerable lending market or liquidity pool, triggering a positive rebase for all holders. They then call a function that uses their now-inflated balanceOf as collateral to borrow assets or mint protocol tokens. Crucially, the attacker's initial donation is made with tokens acquired via flash loan, and the subsequent rebase does not increase the share balance of other users within the same transaction, leaving their collateral ratios computed on pre-rebase balances. After draining value, the attacker repays the flash loan, and the protocol is left with devalued rebasing tokens as bad debt.

From a developer's standpoint, the root cause is the violation of the constant balance invariant within a transaction context. Standard token integrations use balanceOf as a trusted snapshot, but rebasing functions can be called by any address, making the balance a mutable, oracle-like price feed. Secure integration requires using the token's shares mechanism directly or employing a snapshot of shares taken at the start of the transaction. Failing to do so creates a classic read-only reentrancy vulnerability, where state changes during a call alter the result of a previously read value. This flaw is not in the rebasing token itself but in the external protocol's incorrect assumptions about its behavior.

Mitigating this exploit requires defensive integration patterns. The most robust solution is for protocols to track user deposits and rewards using the rebasing token's internal share accounting (e.g., balanceOfShares) and only convert to the displayed balance for UI purposes. Alternatively, protocols can implement a non-reentrant modifier on critical functions and cache the balanceOf return value in memory at the very start of execution to prevent mid-transaction state changes. Auditors now specifically check for rebasing token compliance, as their proliferation in DeFi has turned this once-esoteric flaw into a critical, well-known attack surface requiring explicit handling in smart contract design.

REBASING TOKENS

Common Misconceptions

Rebasing tokens are a unique asset class that adjust their supply to maintain a target price peg, but their mechanics are often misunderstood, leading to security risks and financial loss.

A rebasing token exploit is a smart contract vulnerability where an attacker manipulates the token's supply-adjustment mechanism to steal funds or artificially inflate their balance. It works by exploiting the timing between a rebase event and a token transfer. A common method is the donation attack, where an attacker donates a large number of tokens to a liquidity pool just before a rebase, causing the pool's total supply to spike. The rebase calculation then credits all liquidity providers (LPs) with a proportionally large amount of new tokens. The attacker, as an LP, receives these tokens and then withdraws their initial donation plus the inflated rewards, draining value from other LPs. This exploits the fact that rebase calculations often use the total supply at a specific block, not accounting for malicious, temporary inflation.

REBASING TOKEN EXPLOIT

Frequently Asked Questions (FAQ)

A rebasing token exploit is a sophisticated attack that manipulates the elastic supply mechanism of a token to drain value from a protocol. This FAQ addresses the mechanics, historical examples, and preventive measures.

A rebasing token exploit is a smart contract attack where an attacker manipulates the elastic supply mechanism of a token to artificially inflate their share of a liquidity pool or vault, allowing them to withdraw more assets than they deposited. This is achieved by triggering a rebasing event—a change in the token's total supply while maintaining each holder's proportional ownership—during the execution of a vulnerable function. The exploit typically targets protocols that calculate user balances based on a snapshot taken before the rebase occurs, creating a discrepancy between the internal accounting and the actual token balance.

ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected Directly to Engineering Team
Rebasing Token Exploit: Definition & Attack Vector | ChainScore Glossary