Stale transaction state in mempool when sender receiver pipe fails
When a transaction is submitted, it is added to the mempool before being forwarded to the transaction ingress. If the forwarding channel fails, the transaction remains stuck in the mempool and cannot be resubmitted because it is considered a duplicate.
- Disclosed after under an hour
#43326 [BC-Insight] stale transaction state in mempool when sender receiver pipe fails
#43326 [BC-Insight] Stale Transaction State in Mempool When Sender/Receiver Pipe Fails
Submitted on Apr 4th 2025 at 15:59:54 UTC by @Blockian for Attackathon | Movement Labs
- Report ID: #43326
- Report Type: Blockchain/DLT
- Report severity: Insight
- Target: https://github.com/immunefi-team/attackathon-movement/tree/main/networks/movement/movement-full-node
- Impacts:
Description
Movement Bug Report
Stale Transaction State in Mempool When Sender/Receiver Pipe Fails
Summary
When a transaction is submitted to a node, it is first added to the core_mempool and then forwarded to the transaction_ingress via an mpsc::Sender. However, if the channel send operation fails (e.g., due to a broken pipe, etc...), the transaction remains in the mempool without any follow-up processing or cleanup. This results in a stale transaction that cannot be re-submitted or processed properly until the GC occurs.
Root Cause Analysis
In the submit_transaction method:
async fn submit_transaction(
&mut self,
transaction: SignedTransaction,
) -> Result<SubmissionStatus, Error> {
// ... (omitted non-relevant code)
let status = self.core_mempool.add_txn(
transaction.clone(),
0,
sequence_number,
TimelineState::NonQualified,
true,
);
match status.code {
MempoolStatusCode::Accepted => {
// ... (omitted non-relevant code)
self.transaction_sender
.send((application_priority, transaction))
.await
.map_err(|e| anyhow::anyhow!("Error sending transaction: {:?}", e))?;
// ...
}
// report status
Ok((status, None))
}
The key issue lies in the fact that the transaction is added to the core_mempool before attempting to forward it via the transaction_sender and there is no cleanup in case of failure.
If send fails, the transaction remains stuck in the mempool. Because the node considers it "already accepted," resubmission of the same transaction wont work.
Impact
- Stale Transactions: Transactions remain stuck in the mempool but are never propagated to the DA or processed by downstream systems.
- Submission Blockage: The user cannot re-submit the same transaction (same nonce/sequence number) due to mempool duplication checks.
- Silent Failures: The failure mode is silent from the perspective of the user or client — the transaction appears to have been accepted but is effectively discarded.
Proposed Fixes
Rollback on Failure
If transaction_sender.send(...) fails, remove the transaction from the core_mempool to ensure the user can retry.
Proof of Concept
Proof of Concept (PoC)
- Modify the
submit_transactionfunction to simulate a failure intransaction_sender.send(e.g., by manually dropping the receiver or inserting a forced error). - Submit a valid transaction.
- Observe that the transaction is stored in the
core_mempoolbut never forwarded to the data availability (DA) layer or any execution pipeline. - Attempt to re-submit the transaction with the same sender and sequence number — it will be rejected as a duplicate, despite never being processed.
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
The transaction is added to the mempool before the send operation, and there is no rollback if the send fails.
Impact
Transactions could remain stuck in the mempool and users may be unable to resubmit them, with the failure being silent to the user.
What the attacker needed
Transaction_sender.send fails (e.g., broken pipe)
The fix
If the send fails, the transaction should be removed from the core_mempool so the user can retry.
How it was found
- Modify the submit_transaction function to simulate a failure in transaction_sender.send.
- Submit a valid transaction.
- Observe that the transaction is stored in the core_mempool but never forwarded.
- Attempt to re-submit the transaction with the same sender and sequence number; it is rejected as a duplicate.
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 mempool is a waiting area for transactions before they are processed. This report shows that if a transaction is placed in the waiting area but then fails to be passed along, it gets stuck there and the user cannot try again because the system thinks it is already waiting.
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.