Skip to content
Leaked secrets Audit finding Intermediate

Public Exposure of Validator Signer Private Key in Executor Struct

The Executor struct in the Movement executor crate declares its validator signer field as public, so any code that can reach an Executor instance can read the validator's private key. The reporter notes this could let malicious code sign fraudulent transactions or leak the key through logging, though no code path that actually prints or extracts it was found.

savi0ur Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#42937 [BC-Insight] Public Exposure of Validator Signer Private Key in Executor Struct

Submitted on Mar 29th 2025 at 19:09:12 UTC by @savi0ur for Attackathon | Movement Labs

Description

Bug Description

The Executor struct contains a field pub signer: ValidatorSigner. The ValidatorSigner type from aptos_types::validator_signer is designed to hold and manage a validator's private key for signing transactions. By declaring this field as pub, it becomes accessible to any code that can reference an Executor instance, exposing the private key to unintended access.

Here’s the relevant code block:
https://github.com/immunefi-team/attackathon-movement/blob/a2790c6ac17b7cf02a69aea172c2b38d2be8ce00/protocol-units/execution/maptos/opt-executor/src/executor/mod.rs#L25

Rust
pub struct Executor {
    /// The executing type.
    pub block_executor: Arc<BlockExecutor<AptosVM>>,
    /// The signer of the executor's transactions.
    pub signer: ValidatorSigner, //@audit-issue this field need to be private, as its holding validators private key.
    transactions_in_flight: Arc<RwLock<GcCounter>>,
    pub(crate) config: Config,
    pub(crate) node_config: NodeConfig,
}
Rust
#[derive(Debug)]
#[cfg_attr(any(test, feature = "fuzzing"), derive(Clone, Serialize, Deserialize))]
pub struct ValidatorSigner {
	author: AccountAddress,
	private_key: bls12381::PrivateKey,
}

Note: ValidatorSigner implements Debug trait, which could print this structure in a log, which will then expose validator's private key.

Impact

Exposing the signer field publicly allows any part of the codebase—or even external crates if the Executor is re-exported to access the ValidatorSigner and, by extension, the validator’s private key. This can lead to:

  • An attacker or malicious code could use the private key to sign fraudulent transactions, compromising the integrity of the blockchain.
  • The private key could be inadvertently logged, or extracted, leading to a complete loss of validator's security.
  • Validators are critical to the consensus mechanism; compromising their keys could destabilize the network.

Recommendation

In Rust, pub fields are accessible outside the module and such sensitive fields should be kept private and only accessible via associated method.

Such sensitive informations should not be logged / serialized in production.

Proof of Concept

Proof Of Concept

  • Validator's instantiate their Executor instance which also hold their signer details.
  • signer holds a struct which contains private key and derives Debug trait. It means this struct is printable.
  • We did not found any instance in the code that's printing signer / whole executor struct, but its not recommended to have this field public as it holds sensitive information.

The original report as published on Immunefi, by savi0ur. 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 signer field holding the validator's private key was declared public instead of private, and the key type also derives Debug so it can be printed.

Impact

Any code that can reference an Executor could read the validator's private key and potentially sign fraudulent transactions or leak the key through logs, which could destabilise the network; the report found no code that actually does this.

What the attacker needed

Code able to reference an Executor instance

The fix

The signer field should be made private and only reachable through a dedicated method, and sensitive data should not be logged or serialised in production.

How it was found

  1. A validator creates an Executor instance, which holds its signer details.
  2. The signer struct contains the private key and derives the Debug trait, so it can be printed.
  3. No code printing the signer or the whole executor was found, but the public field still allows access.

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 validator is a computer that helps decide which transactions are valid, and it proves its identity with a secret key. In the Rust language, marking a field 'pub' means any other code in the project can read it directly. Here the secret key sits in such a public field, so other code could pick it up instead of it being locked away behind a controlled function.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More by savi0ur

View all

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

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.