[low] Ebook symlinks: '~' in link targets, download TOCTOU #43
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by Nye reviewing PR #40 (#27, ebook symlinks). Non-blocking, low.
SafePathrealpath usesPath.expand(target, current), which expands a leading~in a symlink target to$HOME; POSIX treats it as a literal directory name. Only exploitable if$HOMEis inside a library. Fix: for relative targets (Path.type(target) == :relative) usePath.join(current, target) |> Path.expand().EbookController.download: the file could be swapped for a symlink between the check andsend_download. Needs write access to the library.FYI, accepted: after a library is deleted, its ebooks under a symlinked mount (like /media) won't download, because of the no-library "no symlinks at all" rule.