Skip to content
Business logic Audit finding Intermediate

Movement does not allow overwriting transactions with a higher priority, breaking Aptos mempool logic

Movement's transaction pipe rejects any transaction whose sequence number is already in the mempool, even when the new transaction has a higher gas price. This prevents users from replacing a pending transaction to increase its priority, breaking Aptos mempool behaviour and potentially allowing transaction censorship.

HollaDieWaldfee Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#42395 [BC-High] Movement does not allow overwriting transactions with a higher priority, breaking Aptos mempool logic

Submitted on Mar 23rd 2025 at 16:01:58 UTC by @HollaDieWaldfee for Attackathon | Movement Labs

Description

Brief/Intro

When a new transaction is submitted, it is ensured that the sequence number of that transaction is greater than the sequence number of all of the other transactions that have been submitted before. This ensures that a transaction cannot be submitted if it has a sequence number that has already been used. However, Aptos allows submitting a transaction with an already used sequence number if the transaction is not executed yet and if the gas unit price is higher to speed up that transaction.

Vulnerability Details

Let's have a look at what exactly happens.

Submitting a transaction adds it to the core_mempool. When inserting the transaction in the mempool, it is strictly allowed to insert a transaction that's already in the mempool if the gas unit price is higher. This can be verified by taking a look at reference (1).

Aptos allows this so that users can speed up their transactions. For example, a user may submit a transaction but realize it’s not being included quickly enough. By resubmitting the same transaction with a higher gas price, the transaction will be executed faster by the DA light node, which takes transactions from the mempool according to their priority. Allowing resubmission lets the user “update” the gas price to reflect current conditions. With this design, it is ensured that the mempool only stores the "best" version.

However, Movement does not allow submitting transactions with an already used sequence number even if the priority is higher.

Impact Details

The impact can be considered from two different angles.

Firstly, Movement does not comply with how Aptos handles transactions that are already stored in the mempool. As a result, users cannot overwrite a transaction to increase its priority which might lead to that transaction not being executed. Movement utilizes the Aptos core mempool but then breaks the Aptos functionality.

A second point of view is to consider the reasons why blockchains, including Aptos and Ethereum allow such re-submissions of transactions. As mentioned before, one reason is so that users can bump their transaction fees and get their transactions executed faster. This also applies to Aptos because the Aptos sequencer processes transactions based on their priority.
But this is just the most straightforward reason. Consider if users can't bump their gas fees, then transactions can be censored by other actors that submit transactions with higher gas fees.
Also, advanced trading and arbitrage strategies rely on being able to bump transactions fees.

So overall, the issue is submitted under the "Causing network processing nodes to process transactions from the mempool beyond set parameters" impact. We believe such impact is justified as the underlying Aptos core mempool can be considered to provide the "set parameters" and so the full node fails to process transactions that should be considered valid based on the validation rules in the core mempool (i.e. transactions with a higher gas fee).

References

(1): https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/627b4f9e0b63c33746fa5dae6cd672cbee3d8631/mempool/src/core\\_mempool/transaction\\_store.rs#L192-L232

(2): https://github.com/immunefi-team/attackathon-movement/blob/a2790c6ac17b7cf02a69aea172c2b38d2be8ce00/protocol-units/execution/maptos/opt-executor/src/background/transaction\\_pipe.rs#L124

(3): https://github.com/immunefi-team/attackathon-movement/blob/a2790c6ac17b7cf02a69aea172c2b38d2be8ce00/protocol-units/execution/maptos/opt-executor/src/background/transaction\\_pipe.rs#L164-L218

(4): https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/627b4f9e0b63c33746fa5dae6cd672cbee3d8631/mempool/src/core\\_mempool/transaction\\_store.rs#L187-L270

Proof of Concept

Proof of Concept

  1. A new transaction is submitted when transaction_pipe::submit_transaction() is called (reference (2)).
  2. It is ensured that the sequence number of this transaction has not been used already and no transaction with the same sequence number is in the mempool by calling has_invalid_sequence_number(). This can be verified by taking a look at reference (3).
  3. However, as can be seen in reference (4), the core_mempool allows the same transaction to be sent if the gas unit price is higher.

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

Movement is a blockchain project that reuses the Aptos core mempool as part of its execution stack. The target of this report is the opt-executor component, specifically the transaction pipe that accepts transactions and hands them to the mempool:

Text
https://github.com/immunefi-team/attackathon-movement/tree/main/protocol-units/execution/maptos/opt-executor

In Aptos, the mempool is not a simple FIFO queue. Transactions carry a sequence number and a gas unit price, and the mempool is designed to keep only the "best" version of a transaction. If a user submits a transaction and it is not being included quickly enough, the user can resubmit the same transaction (same sequence number) with a higher gas unit price. The mempool accepts the replacement because the new version has a higher priority, and the DA light node, which takes transactions from the mempool according to their priority, executes the faster version. This is the mechanism that lets users bump fees to reflect current conditions.

Movement uses that same Aptos core mempool, but, according to the report, it does not allow the resubmission behaviour that the mempool is built around.

Setup

The report does not describe any accounts, roles, tooling or versions used to test. The only concrete artefacts are the source references the researcher cites:

  1. The Aptos core mempool insertion logic, which permits replacing an existing transaction when the gas unit price is higher:
Text
https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/[redacted]/mempool/src/core_mempool/transaction_store.rs#L192-L232
  1. The Movement transaction pipe entry point, transaction_pipe::submit_transaction():
Text
https://github.com/immunefi-team/attackathon-movement/blob/[redacted]/protocol-units/execution/maptos/opt-executor/src/background/transaction_pipe.rs#L124
  1. The sequence number validation in the same file:
Text
https://github.com/immunefi-team/attackathon-movement/blob/[redacted]/protocol-units/execution/maptos/opt-executor/src/background/transaction_pipe.rs#L164-L218
  1. The core mempool store logic that allows the same transaction to be sent again when the gas unit price is higher:
Text
https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/[redacted]/mempool/src/core_mempool/transaction_store.rs#L187-L270

The report notes that Aptos allows resubmitting a transaction with an already used sequence number if the transaction is not executed yet and the gas unit price is higher.

Finding it

The researcher compared two layers of the same stack. The Aptos core mempool, which Movement reuses, is explicitly written to accept a transaction whose sequence number is already present, provided the incoming gas unit price is higher. That is the mechanism behind fee bumping: the mempool keeps only the best version of a transaction, and the sequencer processes transactions by priority.

Movement's own transaction pipe, however, rejects any transaction whose sequence number has already been used, regardless of priority. The check is performed by has_invalid_sequence_number(). The result is that a user who wants to replace a pending transaction with a higher-fee version is refused before the transaction ever reaches the mempool logic that would have accepted it.

What makes this look wrong is that the two behaviours are contradictory within one system: the mempool is designed to accept the replacement, but the layer in front of it never lets the replacement through.

Exploitation

Step 1: submit the original transaction

A new transaction is submitted when transaction_pipe::submit_transaction() is called (reference (2)). At this point the transaction has a sequence number and a gas unit price, and it is on its way to the core_mempool.

Step 2: the sequence number check rejects the replacement

Before the transaction is inserted, the pipe ensures that the sequence number of this transaction has not been used already and that no transaction with the same sequence number is in the mempool, by calling has_invalid_sequence_number() (reference (3)). If the user resubmits the same transaction with a higher gas unit price, this check fails and the replacement is not accepted.

Step 3: the mempool would have accepted it

As reference (4) shows, the core_mempool allows the same transaction to be sent if the gas unit price is higher. The rejection therefore happens above the mempool, not inside it: the mempool's own validation rules consider the higher-fee transaction valid, but it never gets the chance to apply them.

There is no request, payload or command in the report; the proof of concept is the three-step code path above.

Root cause

The mistake is in the ordering and strictness of validation in Movement's transaction pipe. has_invalid_sequence_number() treats any already-used sequence number as invalid, without considering the gas unit price of the incoming transaction. The Aptos core mempool, by contrast, treats a same-sequence-number transaction with a higher gas unit price as a valid replacement and keeps only the best version.

Because the pipe's check runs before the mempool's insertion logic, the stricter rule wins and the mempool's replacement semantics are never reached. The sequence number check also blocks the fee-bump path that the underlying mempool was built to support.

Impact

The report frames the impact from two angles.

First, Movement does not comply with how Aptos handles transactions already stored in the mempool. Users cannot overwrite a transaction to increase its priority, which might lead to that transaction not being executed. Movement uses the Aptos core mempool but then breaks the Aptos functionality.

Second, the reasons blockchains including Aptos and Ethereum allow such resubmissions matter beyond convenience. Fee bumping lets users get transactions executed faster, since the Aptos sequencer processes transactions by priority. If users cannot bump their gas fees, transactions can be censored by other actors that submit transactions with higher gas fees. Advanced trading and arbitrage strategies also rely on being able to bump transaction fees.

The researcher submits the issue under the impact "Causing network processing nodes to process transactions from the mempool beyond set parameters". The justification given is that the underlying Aptos core mempool can be considered to provide the "set parameters", and the full node fails to process transactions that should be considered valid based on the validation rules in the core mempool, namely transactions with a higher gas fee.

Fix

The report does not describe a fix or a change made in response.

Variants to test

Hunting notes

This kind of bug hides where a project reuses an upstream component but wraps it in its own validation layer. The signal during review is a check in the wrapper that reimplements a rule the upstream component already enforces, especially when the upstream rule is conditional (here, conditional on gas unit price) and the wrapper's version is unconditional. Reading the upstream source next to the wrapper source, as this report does with references (1) through (4), is what exposes the contradiction.

The researcher tied the behaviour to a named impact category by arguing that the upstream mempool defines the "set parameters" and that the node fails to process transactions those parameters consider valid. The report also spells out concrete consequences (censorship by higher-fee transactions, broken fee bumping, broken trading and arbitrage strategies) rather than leaving the impact abstract.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 12 min read.

What happened, in plain words

Movement is a blockchain project. A blockchain is a shared record book that many computers keep copies of, and those computers are called nodes. When someone wants to add a new entry to the book, they send a transaction, which is a small package of instructions. Before a transaction is written into the book, it waits in a holding area called the mempool, which is like the waiting room at a doctor's surgery: patients (transactions) sit there until it is their turn.

Movement did not build its waiting room from scratch. It borrowed the one from another blockchain called Aptos. That borrowed waiting room has a useful feature. If you send a transaction and it is taking too long, you can send the same transaction again with a higher fee, which is called the gas unit price. The waiting room is designed to throw away the old, cheaper copy and keep the new, more expensive one, so your transaction gets seen sooner. This is called fee bumping.

The researcher found that Movement's own front desk, the piece of software that receives transactions before they reach the waiting room, refuses the second copy outright. It checks whether the transaction's sequence number, a counter that keeps transactions in order, has already been used, and if it has, it says no. It does not care that the new copy pays more. So the waiting room never gets the chance to do its job, and the fee bump never happens.

This matters for three reasons. First, Movement is not behaving like Aptos even though it uses Aptos's waiting room. Second, if you cannot raise your fee, someone else can push ahead of you by paying more, which is a form of censorship. Third, trading and arbitrage strategies, which are ways of buying and selling to profit from small price differences, depend on being able to raise fees quickly.

The report was filed under the impact category "Causing network processing nodes to process transactions from the mempool beyond set parameters". In plain terms, the researcher argues that the Aptos waiting room defines the rules (the "set parameters") for what counts as a valid transaction, and Movement's node fails to process a transaction that those rules say is valid, namely one with a higher gas fee.

The product and the feature

Movement is a blockchain project. The part examined here is called opt-executor, and inside it there is a component called the transaction pipe. Think of the pipe as the letterbox on the front door: every transaction goes through it before it reaches the mempool. The mempool is the waiting room where transactions sit until a node picks them up and writes them into the blockchain.

The target of the report is this folder in the project's source code:

Text
https://github.com/immunefi-team/attackathon-movement/tree/main/protocol-units/execution/maptos/opt-executor

This is a web address that points to a folder on GitHub, a website where source code is stored and shared. Opening it shows the files that make up the opt-executor component. The report does not describe any accounts, roles, tools or versions used to test, so there is nothing more to set up than reading the code.

Two ideas appear throughout the report and are worth learning now.

A sequence number is a counter attached to each transaction from the same sender. Transaction one gets sequence number one, transaction two gets sequence number two, and so on. It stops the same transaction from being applied twice, in the same way that a numbered ticket stops two people from claiming the same place in a queue.

A gas unit price is the amount a sender offers to pay per unit of computing work. Nodes prefer transactions that pay more, because they earn the fee. Raising the gas unit price is therefore the standard way to ask to be moved forward in the queue.

The four pieces of code the researcher looked at

The report does not include any requests, payloads or commands. Its evidence is four links to source code, which the researcher numbers (1) to (4). Each link points to a specific place in a file, and the #L part at the end means "lines". For example, #L192-L232 means lines 192 to 232.

  1. The Aptos core mempool insertion logic, which permits replacing an existing transaction when the gas unit price is higher:
Text
https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/[redacted]/mempool/src/core_mempool/transaction_store.rs#L192-L232

This address points to a file called transaction_store.rs inside the Aptos code. The file is written in a programming language called Rust, which is common for blockchain software. The lines in question are the part of the waiting room that decides whether a new transaction may replace one that is already waiting. The researcher's point is that this code says yes when the new gas unit price is higher.

  1. The Movement transaction pipe entry point, transaction_pipe::submit_transaction():
Text
https://github.com/immunefi-team/attackathon-movement/blob/[redacted]/protocol-units/execution/maptos/opt-executor/src/background/transaction_pipe.rs#L124

This address points to line 124 of a file called transaction_pipe.rs in the Movement code. The name submit_transaction() is the name of a function, which is a named block of code that does one job. This function is the front door: it is called whenever a new transaction arrives. The :: in the name is just how Rust writes "the function called submit_transaction that lives inside the module called transaction_pipe".

  1. The sequence number validation in the same file:
Text
https://github.com/immunefi-team/attackathon-movement/blob/[redacted]/protocol-units/execution/maptos/opt-executor/src/background/transaction_pipe.rs#L164-L218

This address points to lines 164 to 218 of the same Movement file. These lines contain the check that rejects a transaction whose sequence number has already been used. The check is performed by a function called has_invalid_sequence_number(), whose name reads as "does this have an invalid sequence number?".

  1. The core mempool store logic that allows the same transaction to be sent again when the gas unit price is higher:
Text
https://github.com/immunefi-team/attackathon-movement-aptos-core/blob/[redacted]/mempool/src/core_mempool/transaction_store.rs#L187-L270

This address points to lines 187 to 270 of the same Aptos file as reference (1), a slightly wider window around the same logic. It is the waiting room's own rulebook for accepting a replacement.

Finding it

The researcher did something simple and powerful: they read the two layers of the same system side by side.

The lower layer is the Aptos core mempool, which Movement reuses. Its rule is conditional: a transaction with a sequence number that is already present is accepted if the incoming gas unit price is higher. That is what makes fee bumping work. The waiting room keeps only the best version of a transaction, and the sequencer, the part of the node that decides the order in which transactions are processed, picks transactions by priority.

The upper layer is Movement's own transaction pipe. Its rule is unconditional: any transaction whose sequence number has already been used is rejected, no matter what it pays. The check is has_invalid_sequence_number().

The contradiction is the finding. The waiting room is built to accept the replacement, but the front desk never lets the replacement through to it. It is like a hotel that advertises room upgrades at the reception desk, but the doorman turns you away at the entrance because you already have a room.

Exploitation

The report's proof of concept is a three-step walk through the code path. There is no request, payload or command to run; the evidence is the order in which the checks happen.

Step 1: submit the original transaction

A new transaction is submitted when transaction_pipe::submit_transaction() is called (reference (2)). At this point the transaction has a sequence number and a gas unit price, and it is on its way to the core_mempool.

In plain words: you press send in your wallet. The wallet hands the transaction to the front door of the node. The transaction carries two labels that matter here: its place in your personal queue (the sequence number) and how much it is willing to pay (the gas unit price). The front door passes it towards the waiting room.

Step 2: the sequence number check rejects the replacement

Before the transaction is inserted, the pipe ensures that the sequence number of this transaction has not been used already and that no transaction with the same sequence number is in the mempool, by calling has_invalid_sequence_number() (reference (3)). If the user resubmits the same transaction with a higher gas unit price, this check fails and the replacement is not accepted.

In plain words: you decide the first transaction is too slow, so you send the same transaction again with a bigger fee. The front desk looks at the sequence number, sees that it has already been used, and says no. It never looks at the bigger fee. The replacement is turned away before it reaches the waiting room.

Step 3: the mempool would have accepted it

As reference (4) shows, the core_mempool allows the same transaction to be sent if the gas unit price is higher. The rejection therefore happens above the mempool, not inside it: the mempool's own validation rules consider the higher-fee transaction valid, but it never gets the chance to apply them.

In plain words: the waiting room's rulebook says the bigger-fee copy is fine and should replace the old one. But the front desk has already said no, so the rulebook is never opened. The problem is not in the waiting room; it is in the layer in front of it.

Root cause

The mistake is in the ordering and strictness of validation in Movement's transaction pipe. has_invalid_sequence_number() treats any already-used sequence number as invalid, without considering the gas unit price of the incoming transaction. The Aptos core mempool, by contrast, treats a same-sequence-number transaction with a higher gas unit price as a valid replacement and keeps only the best version.

Because the pipe's check runs before the mempool's insertion logic, the stricter rule wins and the mempool's replacement semantics are never reached. The sequence number check also blocks the fee-bump path that the underlying mempool was built to support. Here it is applied too broadly: it also blocks the legitimate fee-bump path that the underlying mempool was built to support.

A useful comparison is a bouncer with a list. The list is meant to keep out people who have already been inside. But the bouncer also turns away the same person coming back with a valid re-entry ticket, because the list only says "already been inside", not "already been inside and has no re-entry ticket".

Impact

The report frames the impact from two angles.

First, Movement does not comply with how Aptos handles transactions already stored in the mempool. Users cannot overwrite a transaction to increase its priority, which might lead to that transaction not being executed. Movement uses the Aptos core mempool but then breaks the Aptos functionality.

Second, the reasons blockchains including Aptos and Ethereum allow such resubmissions matter beyond convenience. Fee bumping lets users get transactions executed faster, since the Aptos sequencer processes transactions by priority. If users cannot bump their gas fees, transactions can be censored by other actors that submit transactions with higher gas fees. Advanced trading and arbitrage strategies also rely on being able to bump transaction fees.

In everyday terms: if you cannot pay more to jump the queue, someone who can pay more will always go ahead of you, and your transaction may sit there indefinitely. For a trader trying to take advantage of a small price difference, a transaction that sits still is a lost opportunity.

The researcher submits the issue under the impact "Causing network processing nodes to process transactions from the mempool beyond set parameters". The justification given is that the underlying Aptos core mempool can be considered to provide the "set parameters", and the full node fails to process transactions that should be considered valid based on the validation rules in the core mempool, namely transactions with a higher gas fee.

Fix

The report does not describe a fix or a change made in response.

Variants to test

Hunting notes

This kind of bug hides where a project reuses an upstream component but wraps it in its own validation layer. The signal during review is a check in the wrapper that reimplements a rule the upstream component already enforces, especially when the upstream rule is conditional (here, conditional on gas unit price) and the wrapper's version is unconditional. Reading the upstream source next to the wrapper source, as this report does with references (1) through (4), is what exposes the contradiction.

The researcher tied the behaviour to a named impact category by arguing that the upstream mempool defines the "set parameters" and that the node fails to process transactions those parameters consider valid. The report also spells out concrete consequences (censorship by higher-fee transactions, broken fee bumping, broken trading and arbitrage strategies) rather than leaving the impact abstract.

Glossary

  • Blockchain: a shared record book kept by many computers, where entries are grouped into blocks and linked together.
  • Node: a computer that keeps a copy of the blockchain and helps process transactions.
  • Transaction: a package of instructions sent by a user to be written into the blockchain.
  • Mempool: the holding area where transactions wait before a node processes them.
  • Aptos: a blockchain project whose core mempool Movement reuses.
  • Movement: the blockchain project examined in this report.
  • opt-executor: the Movement component that contains the transaction pipe.
  • Transaction pipe: the part of the node that receives transactions and passes them towards the mempool.
  • Sequence number: a counter attached to each transaction from the same sender, used to keep them in order and stop duplicates.
  • Gas unit price: the amount a sender offers to pay per unit of computing work; higher prices are preferred by nodes.
  • Fee bumping: resubmitting a transaction with a higher gas unit price so it is processed sooner.
  • Priority: the order in which the mempool and sequencer prefer transactions, usually based on the fee offered.
  • Sequencer: the part of the node that decides the order in which transactions are processed.
  • DA light node: the component named in the report that takes transactions from the mempool according to their priority.
  • Function: a named block of code that performs one job.
  • Rust: the programming language used in the source files cited in the report.
  • Validation: the process of checking whether something meets the rules before it is accepted.
  • Replay: sending the same transaction again when it has already been used.
  • Censorship: preventing someone's transaction from being processed, for example by outbidding it with higher fees.
  • Arbitrage: buying and selling to profit from small price differences, often needing fast transactions.
  • Impact category: the label under which a bug report is filed, describing the kind of harm it can cause.
  • Set parameters: in this report, the rules defined by the Aptos core mempool for what counts as a valid transaction.

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.