Skip to content
DoS Audit finding Intermediate

Prevalidation does not validate application priority, sequence number and ID

The DA light node's prevalidation only checks the transaction data and signature, not the application priority, sequence number, or ID. An attacker could send a transaction with an unjustified high priority or a fake ID to cause denial of service.

KlosMitSoss Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#43017 [BC-High] Prevalidation does not validate application priority, sequence number and ID

Submitted on Mar 31st 2025 at 17:28:09 UTC by @KlosMitSoss for Attackathon | Movement Labs

Description

Brief/Intro

When the DA light node validates the transaction data, it does not validate the application priority nor sequence number. As a result, it is not ensured that these values fit the Aptos transaction. For example, a transaction directly sent to the DA light node could still have an application priority of 0 (highest priority) even though this priority is not justified by the gas price specified in the transaction data.

Vulnerability Details

The sequencer DA light node verifies that a transaction is valid.

Rust
	async fn batch_write(
		&self,
		request: tonic::Request<grpc::BatchWriteRequest>,
	) -> std::result::Result<tonic::Response<grpc::BatchWriteResponse>, tonic::Status> {
		let blobs_for_submission = request.into_inner().blobs;

		// make transactions from the blobs
		let mut transactions = Vec::new();
		for blob in blobs_for_submission {
			let transaction: Transaction = serde_json::from_slice(&blob.data)
				.map_err(|e| tonic::Status::internal(e.to_string()))?;

			match &self.prevalidator {
				Some(prevalidator) => {
					// match the prevalidated status, if validation error discard if internal error raise internal error
>>					match prevalidator.prevalidate(transaction).await {
						Ok(prevalidated) => {
							transactions.push(prevalidated.into_inner());
						}
                        ... ...
	}

However, this validation is only done for the transaction.data and not for the application priority, sequence number, and ID.

Rust
	async fn prevalidate(
		&self,
		transaction: Transaction,
	) -> Result<Prevalidated<AptosTransaction>, Error> {
		// Only allow properly signed user transactions that can be deserialized from the transaction.data()
		let aptos_transaction: AptosTransaction =
>>			bcs::from_bytes(&transaction.data()).map_err(|e| {
				Error::Validation(format!("Failed to deserialize AptosTransaction: {}", e))
			})?;

		aptos_transaction
			.verify_signature()
			.map_err(|e| Error::Validation(format!("Failed to prevalidate signature: {}", e)))?;

		Ok(Prevalidated::new(aptos_transaction))
	}

As a result, a transaction could be sent directly to the DA light node with an application priority that does not fit the gas price specified in the transaction data. For example, the price to be paid per gas unit could be really low but the application priority could still be 0 (highest priority).

The fact that there is some prevalidation for the transaction data implies that it is possible to send transactions with aribtrary data. Hence, the prevalidation is needed. However, then the application priority could also be some arbitrary data. But there is no validation for this.

Furthermore, by using a fake transaction ID that matches the transaction ID of a transaction that an attacker wants to DoS, the mempool can be filled with the fake transaction such that the legitimate transaction is skipped.

Rust
	async fn add_mempool_transactions(
		&self,
		transactions: Vec<MempoolTransaction>,
	) -> Result<(), anyhow::Error> {
		let db = self.db.clone();
		tokio::task::spawn_blocking(move || {
			let mempool_transactions_cf_handle = db
				.cf_handle(cf::MEMPOOL_TRANSACTIONS)
				.ok_or_else(|| Error::msg("CF handle not found"))?;
			let transaction_lookups_cf_handle = db
				.cf_handle(cf::TRANSACTION_LOOKUPS)
				.ok_or_else(|| Error::msg("CF handle not found"))?;

			// Add the transactions and update the lookup table atomically
			// in a single write batch.
			// https://github.com/movementlabsxyz/movement/issues/322

			let mut batch = WriteBatch::default();

			for transaction in transactions {
>>				if Self::internal_has_mempool_transaction(&db, transaction.transaction.id())? {
>>					continue;
				}
                ... ...
	}

Impact Details

Transactions could be sent with a lower application priority than what it should have based on the price to be paid per gas unit. Furthermore, transactions with a known transaction ID can be DoSed.

References

Code references are provided throughout the report.

Proof of Concept

Proof of Concept

  1. A transaction with valid data is directly sent to the sequencer DA light node. This transaction is then prevalidated (https://github.com/immunefi-team/attackathon-movement/blob/a2790c6ac17b7cf02a69aea172c2b38d2be8ce00/protocol-units/mempool/move-rocks/src/lib.rs#L139-L141).
  2. It is validated that the transaction data can be deserialized (https://github.com/immunefi-team/attackathon-movement/blob/a2790c6ac17b7cf02a69aea172c2b38d2be8ce00/protocol-units/da/movement/protocol/prevalidator/src/aptos/transaction.rs#L15-L18). However, it is not ensured that the application priority fits the price to be paid per gas unit. Sequence number and transaction ID are also not validated.
  3. In the case of a fake application priority with 0 value, this transaction is now the first to get processed.

The original report as published on Immunefi, by KlosMitSoss. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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 prevalidation function only deserialises and verifies the signature of the transaction data, ignoring the application priority, sequence number, and ID fields.

Impact

Transactions could be sent with a lower application priority than justified by the gas price, and transactions with a known ID could be DoSed by filling the mempool with fake transactions.

What the attacker needed

Ability to send transactions to the DA light node

The fix

The prevalidation should also validate the application priority, sequence number, and ID against the transaction data.

How it was found

  1. Send a transaction with valid data directly to the sequencer DA light node.
  2. The transaction is prevalidated, but only its data is deserialised and its signature verified.
  3. The application priority, sequence number, and ID are not checked against the transaction data.
  4. A transaction with a fake application priority of 0 (highest) is processed first.

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 light node checks transactions before passing them on. It only looked at the main transaction data and its signature, but ignored extra fields like priority and ID. So someone could set a high priority without paying for it, or reuse an ID to block a real transaction.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by KlosMitSoss

View all

25 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.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.