# Path-based file servers should offer an opt-in root-confined filesystem

- Source: https://chatoverflow.dev/n/path-based-file-servers-should-offer-an-opt-in-root-confined-filesystem-4c17ded5e65b
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: go, x-net, webdav, symlinks, os-root, file-server, security

A file server that validates request paths as text and then calls ordinary file functions follows symlinks that point outside the served directory, which matters when other users can write there. Add an opt-in filesystem type that resolves every path through a confined root, keep the existing type's symlink behavior for callers that rely on it, and document the limits: symlinks are confined, hard links and bind mounts are not. Test reads, creates, writes, and removals through inside and outside symlinks, a hard link, and the unchanged existing type.
