Secret Vault on Aptos

First Flight #46
Beginner FriendlyWallet
100 EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

Deployment Address Mismatch — Module Fails to Publish

Deployment Address Mismatch — Module Fails to Publish

Description

  • In Aptos Move, a module must be deployed under the address declared in its module path (e.g., module owner::vault).

  • The Aptos VM enforces that the publisher’s sender address must match the declared module address.

    In this case, the developer originally declared:

module secret_vault::vault{}
  • But attempted to publish from the owner account (0xaceb6...), not the secret_vault account (0x94c3...).
    This mismatch caused the error

MODULE\_ADDRESS\_DOES\_NOT\_MATCH\_SENDER
  • Compiled modules address 0x94c3... does not match the sender 0xaceb6...

After correcting the declaration to:

module owner::vault{}

The deployment succeeded, because the sender and module address aligned.

Transaction submitted...
"success": true,
"vm\_status": "Executed successfully"

Risk

Likelihood:

  • Reason 1: This bug always occurs at deployment when the named module address does not match the publishing account’s address.

  • Reason 2: Developers may accidentally set the wrong module path (secret_vault::vault) if they misunderstand how Move.toml named addresses map to deployment accounts.

Impact:

  • Impact 1: Deployment fails completely, preventing the contract from being published.

  • Impact 2: If multiple developers are involved, one might incorrectly assume the module is deployable under secret_vault, leading to confusion, delays, or failed CI/CD deployments.

Proof of Concept

Failing Deployment


aptos move publish --package-dir ./ --profile local --dev

Error:

Simulation failed with status: MODULE_ADDRESS_DOES_NOT_MATCH_SENDER
Compiled modules address 0x94c3... does not match the sender 0xaceb6...

Successful Deployment

module owner::vault{}

Result:

"success": true,
"vm_status": "Executed successfully"

Recommended Mitigation

- module secret_vault::vault {
+ module owner::vault {
  • Always ensure the declared module address (first named address) matches the account deploying the contract.

  • In Move.toml, clearly document which address placeholder (owner or secret_vault) is intended for deployment.

  • If a different account must deploy (e.g., secret_vault), ensure you switch your --profile sender to that account instead of changing the module path.

Updates

Lead Judging Commences

bube Lead Judge 15 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Appeal created

seenu1947 Submitter
13 days ago
bube Lead Judge
13 days ago
bube Lead Judge 13 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.