Problem
Six provider conversation-history files are written with mode 0o644, making them world-readable. They contain operator questions and full LLM answers that frequently include account IDs, ARNs, IPs, role names, and (in iam) entire policy fragments. Sentry/Linear/Notion correctly use 0o600; the rest don't.
Where
internal/cloudflare/conversation.go:164
internal/k8s/conversation.go:190
internal/iam/conversation.go:159
internal/flyio/conversation.go:121
internal/railway/conversation.go:123
internal/vercel/conversation.go:117
Fix
Standardize on 0o600 for all Save paths:
if err := os.WriteFile(path, data, 0o600); err != nil { ... }
Better: extract a shared internal/convhistory package that encapsulates Load/Save with the tight perms (related issue: "Extract internal/convhistory"). For this ticket, just change the literals.
Also Chmod existing files on Load (idempotent) so installed users get auto-repaired.
Acceptance criteria
- All six listed files use
0o600 on save
stat ~/.clanker/cloudflare-*.json etc shows 0600
- On load, files with weaker perms are Chmod'd to
0o600 (logged at debug level)
- Tests verify the mode after Save
Problem
Six provider conversation-history files are written with mode
0o644, making them world-readable. They contain operator questions and full LLM answers that frequently include account IDs, ARNs, IPs, role names, and (in iam) entire policy fragments. Sentry/Linear/Notion correctly use0o600; the rest don't.Where
internal/cloudflare/conversation.go:164internal/k8s/conversation.go:190internal/iam/conversation.go:159internal/flyio/conversation.go:121internal/railway/conversation.go:123internal/vercel/conversation.go:117Fix
Standardize on
0o600for allSavepaths:Better: extract a shared
internal/convhistorypackage that encapsulates Load/Save with the tight perms (related issue: "Extract internal/convhistory"). For this ticket, just change the literals.Also Chmod existing files on Load (idempotent) so installed users get auto-repaired.
Acceptance criteria
0o600on savestat ~/.clanker/cloudflare-*.jsonetc shows06000o600(logged at debug level)