Beginner FriendlyGameFi
100 EXP
View results
Submission Details
Impact: medium
Likelihood: medium
Invalid

Aptos CLI fails to locate config.yaml when publishing Move contract with named address

Root + Impact

Description

  • Normal behavior:
    The Aptos CLI should detect the .aptos/config.yaml inside the project directory and use it when publishing the Move contract.


  • Issue:
    The CLI instead defaults to looking in the global user directory (C:\Users\USER\.aptos) and fails if that path doesn’t exist, even when a valid config.yaml exists in the project’s .aptos folder.


error: invalid value 'pizza_drop=local' for '--named-addresses <NAMED_ADDRESSES>': Unable to find config C:\Users\USER\.aptos\config.yaml, have you run `aptos init`?
// The CLI fails with an error stating it cannot locate config.yaml in C:\Users\USER\.aptos\config.yaml, even though the file exists in the project directory under C:\Users\USER\2025-08-aptos-pizza-drop\.aptos\config.yaml.

Risk

Likelihood:

  • This will always occur when running Aptos CLI from a project folder that has .aptos/config.yaml, if the command is not explicitly run from within that folder.

  • It is common for developers to run commands from their home directory or project root, making the bug highly reproducible.

Impact:

  • Developers cannot publish Move contracts even if config.yaml exists, blocking progress.

  • Causes unnecessary confusion, since the error message suggests aptos init is missing rather than pointing to the wrong config path.

Proof of Concept

cd C:\Users\USER\
aptos move publish --profile local --named-addresses pizza_drop=local
//Observed Output:
error: invalid value 'pizza_drop=local' for '--named-addresses <NAMED_ADDRESSES>': Unable to find config C:\Users\USER\.aptos\config.yaml, have you run `aptos init`?
Expected Output:
A successful publish using the config in C:\Users\USER\2025-08-aptos-pizza-drop\.aptos\config.yaml.

Recommended Mitigation

- CLI only checks for config.yaml in the user home directory
+ CLI should also check for a `.aptos/config.yaml` in the current working directory (project root),
and prioritize it over the global path.
Alternatively, update the error message to suggest running the command from the correct project folder if .aptos/config.yaml is detected locally.
Updates

Appeal created

bube Lead Judge 12 days ago
Submission Judgement Published
Invalidated
Reason: Out of scope

Support

FAQs

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