Skip to content
Business logic Audit finding Intermediate

Depositing gas fees into the governed gas pool does not work when the CoinStore is frozen

The gas fee deposit function checks that the payer's CoinStore is not frozen, so gas fees cannot be deposited into the governed gas pool when the CoinStore is frozen. An attacker could not exploit this for gain, but it prevents legitimate gas payments for frozen accounts.

HollaDieWaldfee Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#42928 [BC-Medium] Depositing gas fees into the governed gas pool does not work when the CoinStore is frozen

Submitted on Mar 29th 2025 at 14:18:31 UTC by @HollaDieWaldfee for Attackathon | Movement Labs

Description

Brief/Intro

When depositing gas fees into the governed gas pool, it is checked that the CoinStore is not frozen. As a result, gas fees cannot be deposited when the CoinStore is frozen. However, paying gas fees should still be possible even when the CoinStore is frozen.

Vulnerability Details

deposit_gas_fee_v2() deposits the gas fees from the gas payer into the governed gas pool by first withdrawing the gas fees from the CoinStore. Inside of this function, it is ensured that the CoinStore is not frozen which means that the gas fees cannot be paid when the CoinStore is frozen. However, it should be possible to pay for gas fees as collect_into_aggregatable_coin(), which is called inside of collect_fee(), does not check whether the CoinStore is frozen or not. This can be verified by taking a look at reference (1). The same also applies for burn_fee(). It's possible to burn transaction fees even when the CoinStore is frozen.

It is clear that gas payments should be allowed regardless of the frozen status. The freezing mechanism is meant to restrict arbitrary transfers, not gas payments. Therefore, withdraw_from() should be implemented like collect_into_aggregatable_coin().

Impact Details

It is impossible to pay for gas fees when the CoinStore is frozen.

References

(1): https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/627b4f9e0b63c33746fa5dae6cd672cbee3d8631/aptos-move/framework/aptos-framework/sources/coin.move#L616-L645

(2): https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/627b4f9e0b63c33746fa5dae6cd672cbee3d8631/aptos-move/framework/aptos-framework/sources/governed\\_gas\\_pool.move#L152-L158

(3): https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/627b4f9e0b63c33746fa5dae6cd672cbee3d8631/aptos-move/framework/aptos-framework/sources/governed\\_gas\\_pool.move#L115-L117

(4): https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/627b4f9e0b63c33746fa5dae6cd672cbee3d8631/aptos-move/framework/aptos-framework/sources/coin.move#L1168-L1208

(5): https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/627b4f9e0b63c33746fa5dae6cd672cbee3d8631/aptos-move/framework/aptos-framework/sources/coin.move#L1179-L1182

Proof of Concept

Proof of Concept

  1. deposit_gas_fee_v2() is called to deposit gas fees into the governed gas pool. (reference (2)).
  2. This calls deposit_from() to deposit the gas fees from the gas payer to the governed gas pool. (reference (3)).
  3. To do so, the gas fees are withdrawn from the gas payer by calling withdraw_from() (reference (4)).
  4. The call to withdraw the gas fees reverts when the CoinStore is frozen (reference (5)).

The original report as published on Immunefi, by HollaDieWaldfee. 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 withdraw_from function enforces the frozen check, unlike collect_into_aggregatable_coin and burn_fee which do not, so gas fee deposits fail when the CoinStore is frozen.

Impact

It is impossible to pay for gas fees when the CoinStore is frozen, but no funds are at direct risk.

What the attacker needed

CoinStore is frozen

The fix

withdraw_from() should be implemented like collect_into_aggregatable_coin() so that gas payments are allowed regardless of the frozen status.

How it was found

  1. deposit_gas_fee_v2() is called to deposit gas fees into the governed gas pool.
  2. This calls deposit_from() to deposit the gas fees from the gas payer to the governed gas pool.
  3. The gas fees are withdrawn from the gas payer by calling withdraw_from().
  4. The call to withdraw the gas fees reverts when the CoinStore is frozen.

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 CoinStore is a record that holds a user's coins on this blockchain. Freezing it is meant to stop arbitrary transfers, but the code also blocks gas payments, which should still be allowed. This is a logic bug that stops normal operation rather than letting someone steal funds.

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 HollaDieWaldfee

View all

39 more disclosed reports, best first.

More from Movement Labs

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.