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 core: Embed time/tzdata (#7432) 2026-01-13 15:11:35 -07:00
cobra.go cmd: colored error message in WrapCommandFuncForCobra (#7760) (#7768) 2026-06-04 21:41:35 -04:00
commandfactory.go cmd: Use a factory to create the caddy root command (#6533) 2024-08-22 03:29:42 +00:00
commandfuncs.go cmd: unbuffer default logger on startup failure (#8180) 2026-10-09 21:22:40 +00:00
commands.go cmd: validate storage archive entries before import 2026-11-11 11:06:40 -07:00
commands_test.go cmd: unbuffer default logger on startup failure (#8180) 2026-10-09 21:22:40 +00:00
main.go build: bump all dependencies - (Go 1.26 floor) (#8056) 2026-09-30 10:54:12 -06:00
main_test.go cmd: support caddy start on IPv6-only hosts (#7744) 2026-05-20 10:17:34 -04:00
packagesfuncs.go fix: require module path boundaries when matching packages (#7957) 2026-09-13 12:08:09 +10:00
packagesfuncs_split_test.go cmd: make splitModule strictly conform to Go module spec (#7974) 2026-09-03 07:43:34 +10:00
packagesfuncs_test.go fix: require module path boundaries when matching packages (#7957) 2026-09-13 12:08:09 +10:00
removebinary.go core: Windows service integration (#4790) 2022-07-29 14:06:54 -06:00
removebinary_windows.go Fix compilation on Windows 2022-07-28 15:44:36 -06:00
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 caddyhttp: Address some Go 1.20 features (#6252) 2024-04-24 00:05:57 +00:00