Skip to content

Commit 1237059

Browse files
Restrict config file permissions to owner-only
- Change WriteFile mode from 0644 to 0600 - Config may contain auth tokens, so it should not be world-readable
1 parent 846c4c7 commit 1237059

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

config/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (m *Manager) Write(cfg *CLIConfig) error {
120120
return err
121121
}
122122

123-
return m.fs.WriteFile(path, data, 0o644)
123+
return m.fs.WriteFile(path, data, 0o600)
124124
}
125125

126126
// Delete removes the CLI config file if it exists.

0 commit comments

Comments
 (0)