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.
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
- Report ID: #42928
- Report Type: Blockchain/DLT
- Report severity: Medium
- Target: https://github.com/immunefi-team/attackathon-movement-aptos-core/tree/main
- Impacts:
- A bug in the respective layer 0/1/2 network code that results in unintended smart contract behavior with no concrete funds at direct risk
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
Proof of Concept
Proof of Concept
deposit_gas_fee_v2()is called to deposit gas fees into the governed gas pool. (reference (2)).- This calls
deposit_from()to deposit the gas fees from the gas payer to the governed gas pool. (reference (3)). - To do so, the gas fees are withdrawn from the gas payer by calling
withdraw_from()(reference (4)). - The call to withdraw the gas fees reverts when the
CoinStoreis frozen (reference (5)).
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
- deposit_gas_fee_v2() is called to deposit gas fees into the governed gas pool.
- This calls deposit_from() to deposit the gas fees from the gas payer to the governed gas pool.
- The gas fees are withdrawn from the gas payer by calling withdraw_from().
- 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.