Skip to content

fix(cmd): use restrictive file permissions for exported keys#11246

Merged
lidel merged 1 commit intomasterfrom
fix/key-export-file-permissions
Mar 24, 2026
Merged

fix(cmd): use restrictive file permissions for exported keys#11246
lidel merged 1 commit intomasterfrom
fix/key-export-file-permissions

Conversation

@lidel
Copy link
Member

@lidel lidel commented Mar 21, 2026

small tweak to follow best practices

problem

ipfs key export was using os.Create (0o666 pre-umask, typically 0o644) making exported private keys world-readable on multi-user systems.

fix

Use os.OpenFile with 0o600 to match the restrictive permissions the keystore itself uses for key files.

`ipfs key export` was using `os.Create` (0o666 pre-umask, typically
0o644) making exported private keys world-readable on multi-user
systems. Use `os.OpenFile` with 0o600 to match the restrictive
permissions the keystore itself uses for key files.
@lidel lidel requested a review from a team as a code owner March 21, 2026 01:45
@lidel lidel mentioned this pull request Mar 21, 2026
22 tasks
@lidel lidel added the skip/changelog This change does NOT require a changelog entry label Mar 21, 2026
@lidel lidel merged commit 14fc754 into master Mar 24, 2026
23 of 26 checks passed
@lidel lidel deleted the fix/key-export-file-permissions branch March 24, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip/changelog This change does NOT require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants