Files
Dominik Schulz 7e4fa09665 security(fs): reject symlinked store entries escaping the store root (#3654)
safePath only performed a lexical prefix check, so a symlink inside the
store whose target lives outside the root passed validation. Get, Set,
Delete, Prune, Move, Link, LinkTarget, Exists and IsDir then acted on the
real target outside the store. List already resolved symlinks and skipped
escapes; that protection was missing from the read, write and delete paths.

Resolve the longest existing prefix of the requested path and verify the
real location stays within the store root. Walking up to the longest
existing prefix catches symlinked entries and intermediate directory
symlinks while still allowing paths whose trailing components do not exist
yet, e.g. when creating a new secret.

Fixes GHSA-v4c2-4fvx-chr3.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2026-10-10 07:15:17 +02:00
..
2022-01-10 17:29:04 +01:00
2020-05-22 18:26:01 +02:00