Skip to content

Fix permissions not reset on overwrite with --config-dir.#2501

Open
fnando wants to merge 3 commits intomainfrom
keep-config-dir-perms
Open

Fix permissions not reset on overwrite with --config-dir.#2501
fnando wants to merge 3 commits intomainfrom
keep-config-dir-perms

Conversation

@fnando
Copy link
Copy Markdown
Member

@fnando fnando commented Apr 20, 2026

What

Fix permissions not reset on overwrite with --config-dir.

Why

Close #2488

Known limitations

N/A

@fnando fnando self-assigned this Apr 20, 2026
Copilot AI review requested due to automatic review settings April 20, 2026 22:48
@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Apr 20, 2026
@fnando fnando requested review from mootz12 and removed request for Copilot April 20, 2026 22:48
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX Apr 20, 2026
@fnando fnando requested a review from Copilot April 21, 2026 00:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a high-severity security issue where overwriting existing identity files under --config-dir could preserve a previously-insecure Unix file mode (e.g., 0644), leaving newly-written signer secrets world-readable.

Changes:

  • Explicitly chmod overwritten config files to 0600 after writing (Unix).
  • Thread the active config root into fix_config_permissions(...) so permission repair can target the correct directory.
  • Add a regression test ensuring overwrites reset file permissions to 0600.

Comment thread cmd/soroban-cli/src/config/locator.rs Outdated
Comment thread cmd/soroban-cli/src/config/locator.rs
Comment thread cmd/soroban-cli/src/config/locator.rs Outdated
Comment thread cmd/soroban-cli/src/config/locator.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

--config-dir overwrites preserve world-readable signer secrets

2 participants