Skip to content

Commit 1a5099b

Browse files
committed
fix(security): Telegram stderr log 0644→0600 — world-readable file in /tmp
spawnChild() opens /tmp/odek-telegram.log with 0644 permissions, making the Telegram bot's stderr output readable by any user on the system. This log contains startup errors, connection failures, and other diagnostic output that could leak paths or sensitive context. Changed to 0600 (owner-only read/write). The log is a private debugging artifact for the process that created it. Fixes H4 from security audit.
1 parent 86eea65 commit 1a5099b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cmd/odek/telegram.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ func spawnChild() error {
881881
argv[0] = exe
882882

883883
// Open stderr log file for the child so startup errors aren't lost.
884-
stderr, err := os.OpenFile("/tmp/odek-telegram.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
884+
stderr, err := os.OpenFile("/tmp/odek-telegram.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)
885885
if err != nil {
886886
stderr = nil // fallback: child gets /dev/null
887887
}

0 commit comments

Comments
 (0)