caddy/cmd
Matthew Holt 3fea1cc800 cmd: validate storage archive entries before import
Reject absolute, non-canonical, traversing or platform-unsafe keys and
non-regular entries (links, devices, FIFOs) before writing to storage,
so importing an untrusted archive cannot write outside the storage root.
Directory entries are skipped and a single leading "./" is removed, so
archives created with tar(1) from a storage directory still import.

Addresses scan report 89de9a51d786c23e.

Code written by GitHub Copilot (GPT-6.1 Sol, Claude Opus 5.5); reviewed by mholt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-11 11:06:40 -07:00
..
caddy
cobra.go
commandfactory.go
commandfuncs.go
commands.go cmd: validate storage archive entries before import 2026-11-11 11:06:40 -07:00
commands_test.go
main.go
main_test.go
packagesfuncs.go
packagesfuncs_split_test.go
packagesfuncs_test.go
removebinary.go
removebinary_windows.go
storagefuncs.go cmd: validate storage archive entries before import 2026-11-11 11:06:40 -07:00
storagefuncs_test.go cmd: validate storage archive entries before import 2026-11-11 11:06:40 -07:00
x509rootsfallback.go