Misuse of error
The transaction submission function returns a 'TooManyTransactions' error when the sender is not whitelisted, instead of a more appropriate error. This mislabelling could confuse protocol users and developers, making debugging harder, but does not directly enable an attack.
- Disclosed after under an hour
#42895 [BC-Insight] Misuse of error
Submitted on Mar 28th 2025 at 13:56:45 UTC by @okmxuse for Attackathon | Movement Labs
- Report ID: #42895
- Report Type: Blockchain/DLT
- Report severity: Insight
- Target: https://github.com/immunefi-team/attackathon-movement/tree/main/protocol-units/execution/maptos/opt-executor
- Impacts:
Description
Description
The function submit_transaction is invoked during the transaction processing pipeline. Within this function, the following check is performed:
async fn submit_transaction(
&mut self,
transaction: SignedTransaction,
) -> Result<SubmissionStatus, Error> {
// Check whether the account is whitelisted
if !self.is_whitelisted(&transaction.sender())? {
return Ok((MempoolStatus::new(MempoolStatusCode::TooManyTransactions), None));
}
If transaction.sender is not whitelisted, the function returns an error. However, the error type used here is MempoolStatusCode::TooManyTransactions.
This error code, as its name suggests, is intended to indicate that an account has reached its maximum transaction capacity:
// Account reached max capacity per account
TooManyTransactions = 3,
This intended use is further reinforced by its correct application in transaction_store.rs::insert:
if txns.len() >= self.capacity_per_user {
return MempoolStatus::new(MempoolStatusCode::TooManyTransactions).with_message(
format!(
"Mempool over capacity for account. Number of transactions from account: {} Capacity per account: {}",
txns.len(),
self.capacity_per_user,
),
);
}
Here, the error is returned only when the number of transactions from an account exceeds the allowed limit.
Impact
The primary issue with the current implementation is the confusion it may cause for both protocol users and developers. Misusing TooManyTransactions in a whitelist check introduces ambiguity in error handling and makes debugging more difficult.
Recommendation
We recommend either:
- Introducing a new, more appropriate error code to indicate that a transaction sender is not whitelisted.
- Handling the whitelist rejection differently, ensuring error messages accurately reflect the underlying issue.
Proof of Concept
POC
- The
submit_transactionfunction is called during transaction processing. - If the sender is not whitelisted, the following check triggers an error:
if !self.is_whitelisted(&transaction.sender())? {
return Ok((MempoolStatus::new(MempoolStatusCode::TooManyTransactions), None));
}
- However,
MempoolStatusCode::TooManyTransactionsis meant to indicate that the user has exceeded their transaction limit. - In this case, the sender is simply not whitelisted, making the error misleading.
- This misrepresentation can cause confusion for both interacting protocols and users.
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 whitelist check reuses an existing error code meant for a different condition (exceeding transaction capacity) instead of defining a specific error for non-whitelisted senders.
Impact
The misuse of the error code may cause confusion for protocol users and developers, making debugging more difficult, but it does not directly lead to a security breach.
What the attacker needed
None
The fix
The error handling should be fixed by introducing a new, more appropriate error code for non-whitelisted senders or by handling the whitelist rejection differently so that error messages accurately reflect the underlying issue.
How it was found
- The submit_transaction function is called during transaction processing.
- If the sender is not whitelisted, the check triggers an error.
- The error returned is MempoolStatusCode::TooManyTransactions, which is meant for exceeding transaction limits.
- This misrepresentation can cause confusion for protocols and users.
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.
This report is about a confusing error message in a blockchain system. When a transaction comes from an account that is not allowed (not whitelisted), the system says 'too many transactions' instead of 'not allowed'. That mix-up can make it harder for people to understand what went wrong, but it does not let anyone break in.
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.