Files
pipelines/internal/servertoken/private_unix.go
T
alan 84f7e33872 Guard the Go server's request boundary: loopback Host, no Origin on /connect, shared token
The server answered any Host, so a DNS-rebinding page reached /connect (101)
and could drive terminals. Every route now refuses a non-loopback Host on a
loopback connection (421), /connect refuses any Origin (403), and a server
started with -token-file requires X-Pipelines-Token (401; /mcp and /healthz
exempt). The CLI/TUI send the token only to loopback URLs.
2026-11-10 00:59:39 +00:00

14 lines
225 B
Go

//go:build unix
package servertoken
import (
"os"
"syscall"
)
func private(info os.FileInfo) bool {
stat, ok := info.Sys().(*syscall.Stat_t)
return ok && int(stat.Uid) == os.Getuid() && info.Mode().Perm()&0o077 == 0
}