#41518 [BC-High] The transaction to modify the gas price was not processed.
Submitted on Mar 16th 2025 at 06:45:34 UTC by @zhaojie for Attackathon | Movement Labs
Report ID: #41518
Report Type: Blockchain/DLT
Report severity: High
Target: https://github.com/immunefi-team/attackathon-movement/tree/main/protocol-units/execution/maptos/opt-executor
Impacts:
Direct loss of funds
Description
The transaction to modify the gas price was not processed.
Brief/Intro
When the user modifies the gas price, the transaction may be executed repeatedly, or the modification may fail.
Vulnerability Details
In the aptos sdk, when adding a transaction to mempool, if the transaction already exists and the sequence_number is the same, the transaction modified gas_price will be processed: delete existing transactions in mempool and add new ones:
core_mempool.add_txn -> self.transactions.insert(txn_info)
The problem is that Movement Network does not do this.
If sequence_number = 0, duplicate transactions are added to the DA, causing the transaction to be executed repeatedly.
If sequence_number > 0, has_invalid_sequence_number fails. As a result, the gas price cannot be modified.
When sequence_number = 0, If add_txn returns Accepted, the transaction will be submitted to the DA without processing the transaction modifying gas_price:
Since the new transaction modifies gas_price, a different transaction.id is generated, and sequence_number duplicate transactions can be written to DA:
Therefore, the user's transaction will be executed repeatedly.
Impact Details
Transactions are executed repeatedly, resulting in the loss of user funds.
References
https://github.com/immunefi-team/attackathon-movement/blob/a2790c6ac17b7cf02a69aea172c2b38d2be8ce00/protocol-units/execution/maptos/opt-executor/src/background/transaction_pipe.rs#L220
https://github.com/aptos-labs/aptos-core/blob/308d59ec2e7d9c3937c8b6b4fca6dd7e97fd3196/mempool/src/core_mempool/transaction_store.rs#L252-L257
Proof of Concept
Proof of Concept
Alice is a new user sequence_number = 0.
Alice transferred 1000 usdc to Bob and successfully submitted the transaction.
Alice wants to speed up the execution of the transaction, so she changes the gas price.
core_mempool deletes the old transaction and adds the new transaction and returns success.
However, the request is not processed in TransactionPipe.submit_transaction, and the duplicate transaction is written to the DA.
The transaction is executed Alice's balance is deducted twice and Bob receives 2000 usdc.
Was this helpful?