Skip to content

Wallet config file is saved with default permissions #331

Closed

Description

@tvpeter

Describe the bug
The app wallet config command saves wallet configuration into config.toml using default directory permissions. As a result, the plaintext keys are readable, allowing any other local user or process on the host to be able to read the content of the file. A user reading it would reasonably expect the file to be user-only similar to bitcoind's cookie and LND macaroons.

To Reproduce

On a system with the common default :

  • Generate a key and build a secret descriptor via the documented flow (key generate to xprv/tprv, then descriptor).
  • Save a wallet config containing that secret descriptor:
  • bdk-cli wallet -w test config -e "wpkh(…/84'/1'/0'/0/)" -i "wpkh(…/84'/1'/0'/1/)"
  • Inspect the resulting permissions

Expected behavior

The application should enforce strict, user-only permissions for sensitive key-bearing files, matching standard security practices.

Build environment

  • BDK-CLI tag/commit: v4.0.0 5b3cb00
  • OS+version: macOS 26.6.2
  • Rust/Cargo version: 1.98.1
  • Rust/Cargo target:

Activity

  1. added
    bug
    on Sep 21, 2026
  2. self-assigned this
    on Sep 21, 2026
  3. added a commit that references this issue on Sep 25, 2026
    f3a1eaf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions