Skip to content

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

Merged
fnando merged 4 commits intomainfrom
keep-config-dir-perms
Apr 21, 2026
Merged

Fix permissions not reset on overwrite with --config-dir.#2501
fnando merged 4 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
@fnando fnando enabled auto-merge (squash) April 21, 2026 17:38
@fnando fnando merged commit f7f24a9 into main Apr 21, 2026
213 checks passed
@fnando fnando deleted the keep-config-dir-perms branch April 21, 2026 18:00
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in DevX Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

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

3 participants