From e8a06647cdc4ea0a79917aeccdad136fd267848b Mon Sep 17 00:00:00 2001 From: Gubarz <1037896+Gubarz@users.noreply.github.com> Date: Sat, 30 May 2026 22:48:33 -0600 Subject: [PATCH] fix(history): secure history file and directory permissions --- internal/history/history.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/history/history.go b/internal/history/history.go index 59f7712..c775ea7 100644 --- a/internal/history/history.go +++ b/internal/history/history.go @@ -61,10 +61,10 @@ func Append(path string, e Entry) error { if e.Timestamp.IsZero() { e.Timestamp = time.Now() } - if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil { + if err := os.MkdirAll(filepath.Dir(path), 0o700); err != nil { return err } - f, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644) + f, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o600) if err != nil { return err }