posix storage follows relative symlinks through folders (listing, downloads, API, WebDAV) #1113

Open
opened 2026-11-04 08:22:03 +00:00 by Cordy · 0 comments
Owner

Found while building #1097 (ZIP download, zp1097 T5, 2026-11-04). On the posix driver, a relative symlink placed inside a folder (for example space/up -> ../../other) is followed when a path goes through it (/s/<token>/up/Other), so public link listings and downloads, the REST API and WebDAV can reach content outside the folder the path is confined to.

Only someone with file-system access to the storage can plant such a link, so this is not reachable through Cairn itself. The ZIP download already refuses these paths (noLinkBetween in internal/share/zip1097.go); every other surface still follows them.

Fix (research first): resolve paths per segment in the posix driver (rel/resolve) and refuse a symlinked folder segment (and decide on symlinked files), with adversarial tests on every surface. Compare how Nextcloud and ownCloud handle symlinks in local storage (both refuse or ignore them by default).

Milestone v0.8 (security odds and ends before launch).

Found while building #1097 (ZIP download, `zp1097` T5, 2026-11-04). On the posix driver, a relative symlink placed inside a folder (for example `space/up -> ../../other`) is followed when a path goes through it (`/s/<token>/up/Other`), so public link listings and downloads, the REST API and WebDAV can reach content outside the folder the path is confined to. Only someone with file-system access to the storage can plant such a link, so this is not reachable through Cairn itself. The ZIP download already refuses these paths (`noLinkBetween` in `internal/share/zip1097.go`); every other surface still follows them. **Fix (research first):** resolve paths per segment in the posix driver (`rel`/resolve) and refuse a symlinked folder segment (and decide on symlinked files), with adversarial tests on every surface. Compare how Nextcloud and ownCloud handle symlinks in local storage (both refuse or ignore them by default). Milestone v0.8 (security odds and ends before launch).
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#1113
No description provided.